Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(DASH): Fix bad error on DASH DAI #6047

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion lib/util/periods.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,34 @@ shaka.util.PeriodCombiner = class {
for (const codec of match.codecs.split(',')) {
codecs.add(codec);
}
outputStream.codecs = Array.from(codecs).join(',');
const PeriodCombiner = shaka.util.PeriodCombiner;
outputStream.codecs = PeriodCombiner.filterDuplicateCodecs_(
Array.from(codecs)).join(',');
}
}
}

/**
* @param {!Array.<string>} codecs
* @return {!Array.<string>} codecs
* @private
*/
static filterDuplicateCodecs_(codecs) {
// Filter out duplicate codecs.
const seen = new Set();
const ret = [];
for (const codec of codecs) {
const shortCodec = shaka.util.MimeUtils.getCodecBase(codec);
if (!seen.has(shortCodec)) {
ret.push(codec);
seen.add(shortCodec);
} else {
shaka.log.debug('Ignoring duplicate codec');
}
}
return ret;
}

/**
* Clone a Stream to make an output Stream for combining others across
* periods.
Expand Down
Loading