Skip to content

Commit

Permalink
wip4
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Oct 29, 2024
1 parent fc67ea9 commit 18a4984
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/main_thread/decrypt/content_decryptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,17 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
if (this._isStopped()) {
return;
}
this.trigger("tooMuchSessions", {
waitingKeyIds: flatMap(this._initDataQueues.overflowQueue, (k) => {
return k.keyIds ?? [];
}),
activeKeyIds: flatMap(activeRecords, (r: KeySessionRecord): Uint8Array[] => {
return r.getAssociatedKeyIds();
}),
});
return;
if (this._activeSessionsInfo.isFull()) {
this.trigger("tooMuchSessions", {
waitingKeyIds: flatMap(this._initDataQueues.overflowQueue, (k) => {
return k.keyIds ?? [];
}),
activeKeyIds: flatMap(activeRecords, (r: KeySessionRecord): Uint8Array[] => {
return r.getAssociatedKeyIds();
}),
});
return;
}
}
if (this._isStopped()) {
return;
Expand Down Expand Up @@ -733,7 +735,6 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
});
}

// Make sure to disable the processing log if not already done
this._unlockInitDataQueue();
},
onWarning: (value: IPlayerError): void => {
Expand All @@ -758,9 +759,7 @@ export default class ContentDecryptor extends EventEmitter<IContentDecryptorEven
const closeError = e instanceof Error ? e : "unknown error";
log.warn("DRM: failed to close expired session", closeError);
})
.then(() => {
this._unlockInitDataQueue();
})
.then(() => this._unlockInitDataQueue())
.catch((retryError) => this._onFatalError(retryError));

if (!this._isStopped()) {
Expand Down

0 comments on commit 18a4984

Please sign in to comment.