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

fix(dash-playlist-loader): clear out timers on dispose #472

Merged
merged 4 commits into from
Apr 16, 2019

Conversation

gkatsev
Copy link
Member

@gkatsev gkatsev commented Apr 16, 2019

No description provided.

@@ -332,6 +334,7 @@ export default class DashPlaylistLoader extends EventTarget {
if (!playlist.sidx) {
// Continue asynchronously if there is no sidx
// wait one tick to allow haveMaster to run first on a child loader
window.clearTimeout(this.mediaRequest_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we clearing here? seems like this should happen in haveMaster and haveMetadata where mediaRequest is set to null currently

@@ -626,7 +630,8 @@ export default class DashPlaylistLoader extends EventTarget {
// would be to update the manifest at the same rate that the media playlists
// are "refreshed", i.e. every targetDuration.
if (this.master && this.master.minimumUpdatePeriod) {
window.setTimeout(() => {
window.clearTimeout(this.minimumUpdatePeriodTimeout_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't intend for this to happen. If you had a timeout set to go off at 3000ms and are now(at 2500ms) trying to set one to go off at 6000ms, you should be able to. Following what mediaUpdateTimeout does may be what we want, where the timeout is cleared if we reload the loader or pause it

@@ -483,6 +487,7 @@ export default class DashPlaylistLoader extends EventTarget {
// We don't need to request the master manifest again
// Call this asynchronously to match the xhr request behavior below
if (this.masterPlaylistLoader_) {
window.clearTimeout(this.mediaRequest_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should remove this too

@@ -698,7 +703,8 @@ export default class DashPlaylistLoader extends EventTarget {
// update loader's sidxMapping with parsed sidx box
this.sidxMapping_[sidxKey].sidx = sidx;

window.setTimeout(() => {
window.clearTimeout(this.minimumUpdatePeriodTimeout_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

@@ -714,7 +720,8 @@ export default class DashPlaylistLoader extends EventTarget {
}
}

window.setTimeout(() => {
window.clearTimeout(this.minimumUpdatePeriodTimeout_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

@gkatsev gkatsev merged commit 2f1c222 into master Apr 16, 2019
@gkatsev gkatsev deleted the fix-playback-error branch April 16, 2019 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants