Skip to content

Commit

Permalink
fix: Fix legacy codec support by rewriting codec metadata (shaka-proj…
Browse files Browse the repository at this point in the history
…ect#4858)

This fixes legacy codec support by rewriting the codec metadata in the
Stream objects. After capability checking, the converted codec
information will be used.

Co-authored-by: Joey Parrish <[email protected]>
  • Loading branch information
2 people authored and Rodolphe Breton committed Jan 27, 2023
1 parent 0d35891 commit 67e335d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,16 @@ shaka.util.StreamUtils = class {
if (!Capabilities.isTypeSupported(audioFullType)) {
return false;
}
// Update the codec string with the (possibly) converted codecs.
videoCodecs = [videoCodecs, audioCodecs].join(',');
}
const fullType = shaka.util.MimeUtils.getFullOrConvertedType(
video.mimeType, videoCodecs, ContentType.VIDEO);
if (!Capabilities.isTypeSupported(fullType)) {
return false;
}
// Update the codec string with the (possibly) converted codecs.
video.codecs = videoCodecs;
}
const audio = variant.audio;
if (audio) {
Expand All @@ -475,6 +479,8 @@ shaka.util.StreamUtils = class {
if (!Capabilities.isTypeSupported(fullType)) {
return false;
}
// Update the codec string with the (possibly) converted codecs.
audio.codecs = codecs;
}

// See: https://github.com/shaka-project/shaka-player/issues/3380
Expand Down

0 comments on commit 67e335d

Please sign in to comment.