Skip to content

Commit

Permalink
Merge pull request #1283 from canalplus/misc/clean-up-whole-range
Browse files Browse the repository at this point in the history
Clean-up whole buffer in get_time_ranges_for_content.ts to be safe
  • Loading branch information
peaBerberian authored Sep 26, 2023
2 parents c77e63f + 8f79d0d commit a9a3759
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/core/stream/orchestrator/get_time_ranges_for_content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ export default function getTimeRangesForContent(
const { bufferedStart, bufferedEnd } = chunk;
if (bufferedStart === undefined || bufferedEnd === undefined) {
log.warn("SO: No buffered start or end found from a segment.");
const buffered = segmentBuffer.getBufferedRanges();
const len = buffered.length;
if (len === 0) {
return [];
}
return [{ start: buffered.start(0), end: buffered.end(len - 1) }];
return [{ start: 0, end: Number.MAX_VALUE }];
}

const previousLastElement = accumulator[accumulator.length - 1];
Expand Down

0 comments on commit a9a3759

Please sign in to comment.