@@ -749,10 +749,9 @@ private void processMoovAtom(ContainerBox moov) throws ParserException {
749749 // DTS-HD and DTS Express. So we store the format with a placeholder MIME for now, and then
750750 // update the MIME type and pass it to TrackOutput.format(...) based on the info in the first
751751 // sample.
752- boolean needSamplesForMime =
752+ boolean needsSamplesForMimeType =
753753 Objects .equals (track .format .sampleMimeType , MimeTypes .AUDIO_MPEG )
754- || Objects .equals (track .format .sampleMimeType , MimeTypes .AUDIO_DTS )
755- || Objects .equals (track .format .sampleMimeType , MimeTypes .AUDIO_DTS_HD );
754+ || DtsUtil .isDtsBaseAudioMimeType (track .format .sampleMimeType );
756755 boolean needsChapterMetadata = false ;
757756 if (!omitTrackSampleTable && track .chapterTrackId != C .INDEX_UNSET ) {
758757 for (TrackSampleTable chapterSampleTable : chapterSampleTables ) {
@@ -762,7 +761,7 @@ private void processMoovAtom(ContainerBox moov) throws ParserException {
762761 }
763762 }
764763 }
765- if (needSamplesForMime || needsChapterMetadata ) {
764+ if (needsSamplesForMimeType || needsChapterMetadata ) {
766765 mp4Track .pendingFormat = format ;
767766 } else {
768767 mp4Track .trackOutput .format (format );
@@ -1018,15 +1017,16 @@ private int readSample(ExtractorInput input, PositionHolder positionHolder) thro
10181017 .build ()
10191018 : pendingFormat );
10201019 track .pendingFormat = null ;
1021- } else if (track .pendingFormat != null
1022- && (Objects .equals (track .track .format .sampleMimeType , MimeTypes .AUDIO_DTS )
1023- || Objects .equals (track .track .format .sampleMimeType , MimeTypes .AUDIO_DTS_HD ))) {
1020+ } else {
10241021 Format pendingFormat = track .pendingFormat ;
1025- track .trackOutput .format (
1026- DtsUtil .updateFormatWithDtsHdInfo (input , sampleSize , pendingFormat ));
1027- track .pendingFormat = null ;
1028- } else if (trueHdSampleRechunker != null ) {
1029- trueHdSampleRechunker .startSample (input );
1022+ if (pendingFormat != null
1023+ && DtsUtil .isDtsBaseAudioMimeType (track .track .format .sampleMimeType )) {
1024+ track .trackOutput .format (
1025+ DtsUtil .updateFormatWithDtsHdInfo (input , sampleSize , pendingFormat ));
1026+ track .pendingFormat = null ;
1027+ } else if (trueHdSampleRechunker != null ) {
1028+ trueHdSampleRechunker .startSample (input );
1029+ }
10301030 }
10311031
10321032 while (sampleBytesWritten < sampleSize ) {
@@ -1119,8 +1119,7 @@ private int readQuickTimeChapters(ExtractorInput input, PositionHolder seekPosit
11191119 // determine the exact MIME type). We have now applied the chapter metadata, so we can
11201120 // output the format, unless it is also MPEG or DTS audio.
11211121 if (Objects .equals (updatedFormat .sampleMimeType , MimeTypes .AUDIO_MPEG )
1122- || Objects .equals (updatedFormat .sampleMimeType , MimeTypes .AUDIO_DTS )
1123- || Objects .equals (updatedFormat .sampleMimeType , MimeTypes .AUDIO_DTS_HD )) {
1122+ || DtsUtil .isDtsBaseAudioMimeType (updatedFormat .sampleMimeType )) {
11241123 track .pendingFormat = updatedFormat ;
11251124 } else {
11261125 track .trackOutput .format (updatedFormat );
@@ -1384,7 +1383,7 @@ private static final class Mp4Track {
13841383 * A {@link Format} that needs to be passed to {@link #trackOutput}, after being possibly
13851384 * modified based on sample data, before {@link TrackOutput#sampleMetadata} is called.
13861385 */
1387- @ Nullable public Format pendingFormat ;
1386+ @ Nullable private Format pendingFormat ;
13881387
13891388 public Mp4Track (Track track , TrackSampleTable sampleTable , TrackOutput trackOutput ) {
13901389 this .track = track ;
0 commit comments