Skip to content

Commit

Permalink
Merge pull request #1217 from canalplus/misc/dont-abort-streams-on-de…
Browse files Browse the repository at this point in the history
…cipherable

DRM/Stream: do not needlessly restart Streams when Representations become known to be decipherable
  • Loading branch information
peaBerberian authored Feb 9, 2023
2 parents c399359 + f2458e7 commit 074ba45
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/stream/orchestrator/stream_orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,16 @@ export default function StreamOrchestrator(
const segmentBufferStatus = segmentBuffersStore.getStatus(bufferType);
const ofCurrentType = updates
.filter(update => update.adaptation.type === bufferType);
if (ofCurrentType.length === 0 || segmentBufferStatus.type !== "initialized") {
return EMPTY; // no need to stop the current Streams.
if (
// No update concerns the current type of data
ofCurrentType.length === 0 ||
segmentBufferStatus.type !== "initialized" ||
// The update only notifies of now-decipherable streams
ofCurrentType.every(x => x.representation.decipherable === true)
) {
// Data won't have to be removed from the buffers, no need to stop the
// current Streams.
return EMPTY;
}

const segmentBuffer = segmentBufferStatus.value;
Expand Down

0 comments on commit 074ba45

Please sign in to comment.