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

Only consider buffer replacements in the GapController.js for audio a… #4051

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/streaming/controllers/GapController.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import FactoryMaker from '../../core/FactoryMaker';
import Debug from '../../core/Debug';
import Events from '../../core/events/Events';
import EventBus from '../../core/EventBus';
import Constants from '../constants/Constants';

const GAP_HANDLER_INTERVAL = 100;
const THRESHOLD_TO_STALLS = 10;
Expand Down Expand Up @@ -131,7 +132,7 @@ function GapController() {
*/
function _onBufferReplacementStarted(e) {
try {
if (e.streamId !== streamController.getActiveStreamInfo().id || !e.mediaType) {
if (e.streamId !== streamController.getActiveStreamInfo().id || (e.mediaType !== Constants.VIDEO && e.mediaType !== Constants.AUDIO)) {
return;
}

Expand Down Expand Up @@ -305,7 +306,7 @@ function GapController() {
* @private
*/
function _jumpGap(currentTime, playbackStalled = false) {
const enableStallFix = settings.get().streaming.gaps.enableStallFix;
const enableStallFix = settings.get().streaming.gaps.enableStallFix;
const stallSeek = settings.get().streaming.gaps.stallSeek;
const smallGapLimit = settings.get().streaming.gaps.smallGapLimit;
const jumpLargeGaps = settings.get().streaming.gaps.jumpLargeGaps;
Expand All @@ -332,7 +333,7 @@ function GapController() {
seekToPosition = parseFloat(playbackController.getStreamEndTime().toFixed(5));
jumpToStreamEnd = true;
}

if(enableStallFix && isNaN(seekToPosition) && playbackStalled && isNaN(nextRangeIndex) && _isTimeBuffered(ranges, currentTime)) {
if (stallSeek === 0) {
logger.warn(`Toggle play pause to break stall`);
Expand Down