Skip to content

Commit

Permalink
Fix DTS_X audio mime type
Browse files Browse the repository at this point in the history
Issue: #9429

#minor-release

PiperOrigin-RevId: 397717740
  • Loading branch information
kim-vde authored and christosts committed Sep 20, 2021
1 parent 8a910fd commit 46d97bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
([#8906](https://github.com/google/ExoPlayer/issues/8906)).
* Move `Player.addListener(EventListener)` and
`Player.removeListener(EventListener)` out of `Player` into subclasses.
* Rename `MimeTypes.AUDIO_DTS_UHD` to `MimeTypes.AUDIO_DTS_X` and add
required profile to its value
([#9429](https://github.com/google/ExoPlayer/issues/9429)).
* Extractors:
* Support TS packets without PTS flag
([#9294](https://github.com/google/ExoPlayer/issues/9294)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final class MimeTypes {
public static final String AUDIO_DTS = BASE_TYPE_AUDIO + "/vnd.dts";
public static final String AUDIO_DTS_HD = BASE_TYPE_AUDIO + "/vnd.dts.hd";
public static final String AUDIO_DTS_EXPRESS = BASE_TYPE_AUDIO + "/vnd.dts.hd;profile=lbr";
public static final String AUDIO_DTS_UHD = BASE_TYPE_AUDIO + "/vnd.dts.uhd";
public static final String AUDIO_DTS_X = BASE_TYPE_AUDIO + "/vnd.dts.uhd;profile=p2";
public static final String AUDIO_VORBIS = BASE_TYPE_AUDIO + "/vorbis";
public static final String AUDIO_OPUS = BASE_TYPE_AUDIO + "/opus";
public static final String AUDIO_AMR = BASE_TYPE_AUDIO + "/amr";
Expand Down Expand Up @@ -410,7 +410,7 @@ public static String getMediaMimeType(@Nullable String codec) {
} else if (codec.startsWith("dtsh") || codec.startsWith("dtsl")) {
return MimeTypes.AUDIO_DTS_HD;
} else if (codec.startsWith("dtsx")) {
return MimeTypes.AUDIO_DTS_UHD;
return MimeTypes.AUDIO_DTS_X;
} else if (codec.startsWith("opus")) {
return MimeTypes.AUDIO_OPUS;
} else if (codec.startsWith("vorbis")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public void getMediaMimeType_fromValidCodecs_returnsCorrectMimeType() {
assertThat(MimeTypes.getMediaMimeType("dtse")).isEqualTo(MimeTypes.AUDIO_DTS_EXPRESS);
assertThat(MimeTypes.getMediaMimeType("dtsh")).isEqualTo(MimeTypes.AUDIO_DTS_HD);
assertThat(MimeTypes.getMediaMimeType("dtsl")).isEqualTo(MimeTypes.AUDIO_DTS_HD);
assertThat(MimeTypes.getMediaMimeType("dtsx")).isEqualTo(MimeTypes.AUDIO_DTS_UHD);
assertThat(MimeTypes.getMediaMimeType("dtsx")).isEqualTo(MimeTypes.AUDIO_DTS_X);
assertThat(MimeTypes.getMediaMimeType("opus")).isEqualTo(MimeTypes.AUDIO_OPUS);
assertThat(MimeTypes.getMediaMimeType("vorbis")).isEqualTo(MimeTypes.AUDIO_VORBIS);
assertThat(MimeTypes.getMediaMimeType("mp4a")).isEqualTo(MimeTypes.AUDIO_AAC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ private static void parseAudioSampleEntry(
} else if (atomType == Atom.TYPE_dtse) {
mimeType = MimeTypes.AUDIO_DTS_EXPRESS;
} else if (atomType == Atom.TYPE_dtsx) {
mimeType = MimeTypes.AUDIO_DTS_UHD;
mimeType = MimeTypes.AUDIO_DTS_X;
} else if (atomType == Atom.TYPE_samr) {
mimeType = MimeTypes.AUDIO_AMR_NB;
} else if (atomType == Atom.TYPE_sawb) {
Expand Down

0 comments on commit 46d97bd

Please sign in to comment.