dash.js
dash.js copied to clipboard
Fix rerequest segment on quality switch
This PR fixes #3792 - Player re-requests the latest segment on quality change.
I found out that the function StreamProcessor.setExplicitBufferingTime
might be wrongly used in StreamProcessor._bufferClearedForNonReplacement
. I think StreamProcessor._bufferClearedForNonReplacement
is called when the player doesn't need to replace any segment in the buffer, as default. So StreamProcessor.setExplicitBufferingTime
should not be called.
I also noticed, in StreamProcessor._prepareForDefaultQualitySwitch
, there's the comment "We might have aborted the current request. We need to set an explicit buffer time based on what we already have in the buffer". Isn't this case already handled in StreamProcessor._onFragmentLoadingAbandoned
?
Therefore, I have removed the setExplicitBufferingTime
in _bufferClearedForNonReplacement
. Seems the issue is fixed.
I'm sorry.
Except https://github.com/Dash-Industry-Forum/dash.js/pull/3797/commits/754b6be02439dca51d6a10a3568451676bcc044b, the other 10 commits were from #3785. I don't know why they were also added to this PR.
Thanks for this @chanh1964 , I need to check this in detail
Regarding: _" Isn't this case already handled in StreamProcessor.onFragmentLoadingAbandoned"
One thing to keep in mind is that _onFragmentLoadingAbandoned
only takes effect if !scheduleController.getSwitchStrack()
.
Actually there is also a typo in the function :)
@chanh1964 Thanks for the PR, I did some modifications to account for edge cases in #4144 . I am closing this