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 #2079: drop fragCurrent on buffer flush #2080

Closed
wants to merge 1 commit into from

Conversation

mad-gooze
Copy link
Contributor

@mad-gooze mad-gooze commented Jan 14, 2019

This PR will...

Abort AudioStreamController's fragCurrent loader and clear fragCurrent in fragmentTracker on buffer flush

Why is this Pull Request needed?

AudioStreamController may hang up on buffer flush, see #2079 for reproducing info

Are there any points in the code the reviewer needs to double check?

I'll left comments in PR

Resolves issues:

#2079

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

const { loader } = fragCurrent;
if (loader) {
// abort current frag to reload it and re-trigger onFragLoaded
loader.abort();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure this is the best solution because this makes fragCurrent to be requested twice.

}

const state = this.fragmentTracker.getState(fragCurrent);
if (state === FragmentState.APPENDING || state === FragmentState.PARTIAL) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please check this moment - I could not reproduce FragmentState.PARTIAL here so I am not sure this condition is needed

@mtoczko
Copy link
Collaborator

mtoczko commented Jan 23, 2019

@johnBartos

@mtoczko What problems were you seeing that required fragCurrent to be reset on buffer flushed? mtoczko@c361b8d

mad-gooze. He found the problem. I could not reproduce this error.

@stale
Copy link

stale bot commented Mar 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Mar 24, 2019
@stale stale bot closed this Mar 31, 2019
@itsjamie itsjamie reopened this Apr 1, 2019
@stale stale bot removed the Stale label Apr 1, 2019
@johnBartos johnBartos closed this May 7, 2019
@mad-gooze
Copy link
Contributor Author

@johnBartos why did you close this pull?

@johnBartos
Copy link
Collaborator

@mad-gooze I thought that this couldn't be reproduced, but I read the issue comments wrong. I'll reopen.

@@ -836,6 +836,23 @@ class AudioStreamController extends BaseStreamController {
this.state = State.IDLE;
// reset reference to frag
this.fragPrevious = null;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of your changes, can you try this instead?

    const media = this.mediaBuffer ? this.mediaBuffer : this.media;
    if (media) {
      // filter fragments potentially evicted from buffer. this is to avoid memleak on live streams
      this.fragmentTracker.detectEvictedFragments(ElementaryStreamTypes.AUDIO, media.buffered);
    }

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.

None yet

4 participants