-
Notifications
You must be signed in to change notification settings - Fork 238
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
[DASHTree] handle new Period better #1175
Conversation
7ba0047
to
f6b833e
Compare
This works great now:
|
i suspect DEMUX_SPECIALID_STREAMCHANGE is what we do in HLS for x-discontuity so this brings it in line with that? |
@matthuisman yea, also matches what happens with MPD VOD when it has multiple Periods. The STREAMCHANGE allows kodi to reinitialize playback and pick the proper streams from the newly available audio/video. It will also reinit drm so new period could use different keys or not have drm at all. |
Awesome! Any clever ideas to stop frame rate switching on short periods? Users often find adverts trigger it and then it triggers again going back to main content. I can't think of any clean way to fix that |
suggest to not spam this PR for OP discussions |
13b58b5
to
212ac1d
Compare
I ran this on a live stream for several hours today. There were 21 new periods and it worked seamlessly across them all. Ready to merge IMHO |
I don't think that any changes should be needed to Gut feeling is that stream IDs are causing you all the trouble. Normally for VOD it would look like this in the log as you progress from first to second period:
Live HLS is similar but only first chapter is 100x, following chapters are the discontinuity sequence number * 1000 + stream number. For DASH no I think that period ID for DASH can be alpha numeric so that doesn't help much though. So perhaps we just increment sequentially based on matching new periods to old periods? |
212ac1d
to
f1c8489
Compare
You're right. I removed the changes from |
@glennguy this should now work for live dash with multi-period exactly the same way it does for VOD. AFAIK VOD has no issues with the lack of distinct stream ids so I think this is good to merge. |
Thanks for updating @tmm1 I can't actually verify properly with the one from the dash live simulator, would you be able to have a look?
VOD has distinct stream IDs normally e.g period 1 video is usually 1001, period 2 2001 etc, I'm not certain this is an issue but thought it may be. Not trying to be a pain, just thinking that it ideally works on more than the 1 test stream. I know there's going to be plenty of cases (maybe yours) where there's just the main program content, and we only ever see going from 1 period to 2, then back to 1. But it would be great to know it can work well in most if not all cases. If you want we can bring this in and fix other cases going forward, what do you think? |
Seems in this one ISA is happen to continue streaming the Period it starts with. This is because In the real world MPDs I saw, the
In mine I saw it go up to 3-4 periods sometimes and it still works correctly.
This would be my preference. |
I found a VOD to test and confirmed the stream ids do change there. So I will try to make it work the same way here. |
f1c8489
to
4087d73
Compare
Done, confirmed it goes from 1001 to 2001 to 3001 on live stream. |
Thanks @tmm1 for all the updates! |
I take the point that the dash live simulator test stream is a very 'out there' case, and something needs to happen to allow the periods in that one to actually transition. |
Thanks for merging!
Open to suggestions. I'm not sure how to tell the period has ended. That stream still plays correctly so it didn't seem like a huge priority. |
Yeah I had a couple of ideas but I think it's not a super huge priority either. I think the stream plays still only because the new period is still using the same segments and there's no actual discontinuity. What I found though is it stops once it gets to the 5:00 mark.
Anyway lets see what comes of this change and go from there. |
Description
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: