Skip to content

Commit

Permalink
improve clear logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaDemchenko committed Aug 23, 2024
1 parent 38dd3e2 commit 14504ac
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ export class CustomSegmentStorage implements ISegmentsStorage {
this.getCurrentPlaybackTime = getCurrentPlaybackTime;
}

setEngineRequestSegmentDurationCallback(
getSegmentDurationFromEngineRequest: () => {
setLastRequestedSegmentDurationCallback(
getLastRequestedSegmentDuration: () => {
startTime: number;
endTime: number;
},
) {
this.getLastRequestedSegmentDuration = getSegmentDurationFromEngineRequest;
this.getLastRequestedSegmentDuration = getLastRequestedSegmentDuration;
}

async getSegmentData(
Expand Down Expand Up @@ -322,7 +322,8 @@ export class CustomSegmentStorage implements ISegmentsStorage {

const isPastThreshold =
endTime <
currentPlayback - (httpDownloadTimeWindow - highDemandTimeWindow);
currentPlayback -
(httpDownloadTimeWindow - highDemandTimeWindow) * 1.05;

if (isPastThreshold) {
this.storageSegmentsCount--;
Expand Down

0 comments on commit 14504ac

Please sign in to comment.