Skip to content

Commit

Permalink
fix: Fix type passed to isTypeSupported in some cases (#7233)
Browse files Browse the repository at this point in the history
Fixes #7232

On some Comcast devices (Flex series) calling `isTypeSupported()` with
base codec string results in video playback failure and an immediate
application crash.
  • Loading branch information
agajassi authored Sep 3, 2024
1 parent 3f7915b commit 3e3953d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,8 @@ shaka.media.StreamingEngine = class {
reference.startTime <= appendWindowEnd,
logPrefix + ' segment should start before append window end');

const codecs = MimeUtils.getCodecBase(
reference.codecs || mediaState.stream.codecs);
const fullCodecs = (reference.codecs || mediaState.stream.codecs);
const codecs = MimeUtils.getCodecBase(fullCodecs);
const mimeType = MimeUtils.getBasicType(
reference.mimeType || mediaState.stream.mimeType);
const timestampOffset = reference.timestampOffset;
Expand All @@ -1984,7 +1984,7 @@ shaka.media.StreamingEngine = class {
const isResetMediaSourceNecessary =
mediaState.lastCodecs && mediaState.lastMimeType &&
this.playerInterface_.mediaSourceEngine.isResetMediaSourceNecessary(
mediaState.type, mediaState.stream, mimeType, codecs);
mediaState.type, mediaState.stream, mimeType, fullCodecs);
if (isResetMediaSourceNecessary) {
let otherState = null;
if (mediaState.type === ContentType.VIDEO) {
Expand Down

0 comments on commit 3e3953d

Please sign in to comment.