Skip to content

Commit

Permalink
fix: Fix legacy codec support by rewriting codec metadata (#4858)
Browse files Browse the repository at this point in the history
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
cuyl and joeyparrish committed Jan 13, 2023
1 parent e062175 commit 92abfbc
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 92abfbc

Please sign in to comment.