Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #3610 minBufferToKeep #3611

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/streaming/controllers/BufferController.js
Expand Up @@ -46,6 +46,7 @@ import {HTTPRequest} from '../vo/metrics/HTTPRequest';
const BUFFERING_COMPLETED_THRESHOLD = 0.1;
const BUFFER_END_THRESHOLD = 0.5;
const BUFFER_RANGE_CALCULATION_THRESHOLD = 0.01;
const CURRENT_TIME_REQUEST_START_CLEAR_THRESHOLD = 0.5;
const QUOTA_EXCEEDED_ERROR_CODE = 22;

const BUFFER_CONTROLLER_TYPE = 'BufferController';
Expand Down Expand Up @@ -646,7 +647,7 @@ function BufferController(config) {

// Ensure we keep full range of current fragment
if (currentTimeRequest) {
startRangeToKeep = Math.min(currentTimeRequest.startTime, startRangeToKeep);
startRangeToKeep = Math.min(currentTimeRequest.startTime - CURRENT_TIME_REQUEST_START_CLEAR_THRESHOLD, startRangeToKeep);
} else if (currentTime === 0 && playbackController.getIsDynamic()) {
// Don't prune before the live stream starts, it messes with low latency
return [];
Expand Down