Skip to content

Commit

Permalink
fix: Add more info in getVariantTracks for muxed streams (#8002)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Feb 3, 2025
1 parent 6c9b634 commit 8e17bad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,9 @@ shaka.util.StreamUtils = class {
* @return {shaka.extern.Track}
*/
static variantToTrack(variant) {
const ManifestParserUtils = shaka.util.ManifestParserUtils;
const ContentType = shaka.util.ManifestParserUtils.ContentType;

/** @type {?shaka.extern.Stream} */
const audio = variant.audio;
/** @type {?shaka.extern.Stream} */
Expand Down Expand Up @@ -1385,6 +1388,16 @@ shaka.util.StreamUtils = class {
track.audioSamplingRate = video.audioSamplingRate;
track.spatialAudio = video.spatialAudio;
track.originalLanguage = video.originalLanguage;
track.audioMimeType = videoMimeType;
const allCodecs = videoCodec.split(',');
try {
track.videoCodec = ManifestParserUtils.guessCodecs(
ContentType.VIDEO, allCodecs);
track.audioCodec = ManifestParserUtils.guessCodecs(
ContentType.AUDIO, allCodecs);
} catch (e) {
// Ignore this error.
}
}
}

Expand Down

0 comments on commit 8e17bad

Please sign in to comment.