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

Clear audio tick interval when we stopLoad. #2110

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/controller/audio-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class AudioStreamController extends BaseStreamController {
this.demuxer.destroy();
this.demuxer = null;
}
this.clearInterval();
this.state = State.STOPPED;
}

Expand Down
5 changes: 5 additions & 0 deletions src/controller/buffer-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class BufferController extends EventHandler {
// signals that mediaSource should have endOfStream called
private _needsEos: boolean = false;

// Track whether the parsed manifest signaled alternate audio
private _altAudio: boolean = false;

// this is optional because this property is removed from the class sometimes
public audioTimestampOffset?: number;

Expand Down Expand Up @@ -138,6 +141,7 @@ class BufferController extends EventHandler {
// sourcebuffers will be created all at once when the expected nb of tracks will be reached
// in case alt audio is not used, only one BUFFER_CODEC event will be fired from main stream controller
// it will contain the expected nb of source buffers, no need to compute it
this._altAudio = data.altAudio;
this.bufferCodecEventsExpected = data.altAudio ? 2 : 1;
logger.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`);
}
Expand Down Expand Up @@ -203,6 +207,7 @@ class BufferController extends EventHandler {
this.flushRange = [];
this.segments = [];
this.appended = 0;
this.bufferCodecEventsExpected = this._altAudio ? 2 : 1;
}

this.hls.trigger(Events.MEDIA_DETACHED);
Expand Down