[backport] [DASHTree] handle new Period better #1178
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
backport for #1175
i observed that on a playlist where new
<Period>
is added when going into commercial break, the player would stall out for 30s and then jump ahead in the stream.the logs showed it as so:
Motivation and context
The code would not previously deal with new
<Period>
appearing, and would only map Period entries based on their index.So if originally the MPD had one period, then all of a sudden it had two, only the first would be updated.
Eventually, if the old period was removed then all of a sudden it would resume playback but skip ahead because it would start adding segments from the new period into the old period again once the position (idx==0) matched again.
Now the code will properly insert new periods into the tree, and also notice when one period ends and switch into the next one.
This looks as so in the new logs:
How has this been tested?
compile and runtime tested using a local news stream that keeps adding new Period and was not working previously
Screenshots (if appropriate):
Types of change
Checklist: