-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Buffer events #215
Buffer events #215
Conversation
thanks @tchakabam this will be really easier to review and merge ! |
Hi @tchakabam I checked out your branch, and found an issue (reproducible in FF, not in Chrome) load Big Buck Bunny, seek 60s from the end, wait for buffer EOS to be reached buffer is not flushed appropriately, leading to smooth switching not working as expected. see logs with your branch:
and with master branch:
|
it is working fine on Chrome
|
OK interesting will check it out! Thanks for having done this test. |
ok I understand what is going on. I am on it |
@mangui hey that's great! because i haven't had time to really investigate it. and probably you have a better idea about these details. maybe you can get things straight while keeping the separation between MSE objects and the "fragment fetch-and-demux machine" as laid out here. i think things will get more clear as we separate these functions into different classes. |
@tchakabam, IMHO there is a design issue with current pattern also when you stress a little bit => the flushing logic needs to be moved to another layer. and a controller (maybe directly in src/hls.js for now) should stop fragment/stream loader upon buffer flushing and restart it upon BUFFER_FLUSHED. plz comment, suggestions welcome |
@mangui ok that is a very obvious issue i agree, and also i think we can definitely solve it. in fact it was probably my mistake to remove the adding this state back should solve it as as long as we are in flushing state, no further segment loading should happen, correct? i will compare again with previous implementation and fix that aspect. |
see dailymotion@523b177 |
@mangui wow you were fast :) cool, hope this will work 👍 i think from a logical point of view we have covered the case that we obviously broke by removing that state from the fetching scheduler. so it should be good now. but you are wise to be cautious ;) |
closing as merged |
…xer flush (#215) * Refactor minProbeByteLength to only be enforced on transmuxer flush JW8-8993
@mangui This is introducing the new buffer events and separates MSE buffering and HLS scheduling concerns into separate functions.
Most important is that the streaming state machine does not run the appending anymore, it's all done via the buffer events and SourceBuffer ended callback. Same for the flushing.
There is still some shared state across the functions caring of MSE buffering (only in
doAppending
actually for the error state), but it should not be too hard to cleanly isolate that now.Essentially all the logic has just been copy-pasted around, and in some place the state setup has been simply called before or after the event triggers, but I checked and there is no shared state in these cases between the state machine and the buffer event handlers.
The other important part is that we are doing the flushing, EOS and appending all async now, dispatched to the MSE callbacks if necessary when the SB is busy (see respective flags).