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
Conversation
const { loader } = fragCurrent; | ||
if (loader) { | ||
// abort current frag to reload it and re-trigger onFragLoaded | ||
loader.abort(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
mad-gooze. He found the problem. I could not reproduce this error. |
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. |
@johnBartos why did you close this pull? |
@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; | |||
|
There was a problem hiding this comment.
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);
}
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