[HLS] Fix misaligned periods update for VOD and crash #1713
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
commit 1: Fix misaligned periods update
to reproduce easily the problem use HLS VOD with multiperiods
and set "Stream selection type" to "Manual OSD"
while in playback use kodi GUI to change video stream quality
you can see that when quality change the chapters increase and sometimes other oddities and errors in the log appear
even sometimes the playback becomes unstable,
imo it could be not the best fix, i do not currently have the patience to invest days to do something better, since i have pending other tasks
the problem is that ProcessChildManifest is called e.g. from OnStreamChange with current period/rep
this is ok for live stream but with VOD there are static periods, if you provide the current period e.g. 2
it start to parse manifest and update data from period 2 onwards but manifest periods start from 1, this cause big mess and misaligned periods data
commit 2:
to reproduce the problem is needed an HLS VOD with multiperiods and DRM
and is required to have more streams with differents PSSH (so the use case of D+)
then set "Stream selection type" to "Test" in order to switch stream quality automatically to trigger the DEMUX_SPECIALID_STREAMCHANGE
I added the explanation of the problem in the code, because it is a particular case that might not be so straightforward to understand
Motivation and context
fix #1707
How has this been tested?
tested with D+ and user confirmed
Screenshots (if appropriate):
Types of change
Checklist: