Skip to content

Commit

Permalink
perf(DRM): compare init data only when config flag is set (#6952)
Browse files Browse the repository at this point in the history
  • Loading branch information
tykus160 authored Jul 1, 2024
1 parent c6d834e commit be22e5b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -736,12 +736,13 @@ shaka.media.DrmEngine = class {
// Note that some init data are extremely large and can't portably be used
// as keys in a dictionary.

const metadatas = this.activeSessions_.values();
for (const metadata of metadatas) {
if (shaka.util.BufferUtils.equal(initData, metadata.initData) &&
this.config_.ignoreDuplicateInitData) {
shaka.log.debug('Ignoring duplicate init data.');
return;
if (this.config_.ignoreDuplicateInitData) {
const metadatas = this.activeSessions_.values();
for (const metadata of metadatas) {
if (shaka.util.BufferUtils.equal(initData, metadata.initData)) {
shaka.log.debug('Ignoring duplicate init data.');
return;
}
}
}

Expand Down

0 comments on commit be22e5b

Please sign in to comment.