Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ private static void parseVideoSampleEntry(
@C.ColorTransfer int colorTransfer = Format.NO_VALUE;
// The format of HDR static info is defined in CTA-861-G:2017, Table 45.
@Nullable ByteBuffer hdrStaticInfo = null;
@Nullable DolbyVisionConfig dolbyVisionConfig = null;

while (childPosition - position < size) {
parent.setPosition(childPosition);
Expand Down Expand Up @@ -1607,10 +1608,9 @@ private static void parseVideoSampleEntry(
false, "initializationData must already be set from hvcC or avcC atom");
}
parent.setPosition(childStartPosition + Mp4Box.HEADER_SIZE);
@Nullable DolbyVisionConfig dolbyVisionConfig = DolbyVisionConfig.parse(parent);
if (dolbyVisionConfig != null) {
codecs = dolbyVisionConfig.codecs;
mimeType = MimeTypes.VIDEO_DOLBY_VISION;
@Nullable DolbyVisionConfig parsedDvConfig = DolbyVisionConfig.parse(parent);
if (parsedDvConfig != null) {
dolbyVisionConfig = parsedDvConfig;
}
} else if (childAtomType == Mp4Box.TYPE_vpcC) {
ExtractorUtil.checkContainerInput(mimeType == null, /* message= */ null);
Expand Down Expand Up @@ -1780,6 +1780,11 @@ private static void parseVideoSampleEntry(
childPosition += childAtomSize;
}

if (dolbyVisionConfig != null) {
mimeType = MimeTypes.VIDEO_DOLBY_VISION;
codecs = dolbyVisionConfig.codecs;
}

// If the media type was not recognized, ignore the track.
if (mimeType == null) {
return;
Expand Down