mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Fix two bugs in the updated code
If we handle the "codecs" in HlsPlaylistParser.java rather than in HlsMediaPeriod.java, since the "codecs" property includes both audio and video codec names here, we can't update it directly. Only video part should be updated by Dolby codec string.
This commit is contained in:
parent
e8d29dc3d6
commit
545d37c104
@ -1191,7 +1191,7 @@ public final class Format {
|
||||
}
|
||||
}
|
||||
if (MimeTypes.VIDEO_DOLBY_VISION.equals(sampleMimeType)) {
|
||||
codecs = manifestFormat.codecs;
|
||||
codecs = Util.getCodecsOfType(manifestFormat.codecs, C.TRACK_TYPE_VIDEO);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -428,8 +428,20 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isDolbyVisionFormat(videoRange, codecs, supplementalCodecs, supplementalProfiles)) {
|
||||
codecs = supplementalCodecs != null ? supplementalCodecs : codecs;
|
||||
String videoCodecs = Util.getCodecsOfType(codecs, C.TRACK_TYPE_VIDEO);
|
||||
if (isDolbyVisionFormat(videoRange, videoCodecs, supplementalCodecs, supplementalProfiles)) {
|
||||
videoCodecs = supplementalCodecs != null ? supplementalCodecs : videoCodecs;
|
||||
String[] codecArray = Util.splitCodecs(codecs);
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String codec : codecArray) {
|
||||
if (builder.length() > 0) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append(MimeTypes.getTrackTypeOfCodec(codec) == C.TRACK_TYPE_VIDEO
|
||||
? videoCodecs
|
||||
: codec);
|
||||
}
|
||||
codecs = builder.length() > 0 ? builder.toString() : codecs;
|
||||
}
|
||||
|
||||
String resolutionString =
|
||||
|
Loading…
x
Reference in New Issue
Block a user