Skip to content
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

[Dash] Correctly set timeshift_buffer (live) #626

Merged
merged 1 commit into from
Apr 8, 2021
Merged

[Dash] Correctly set timeshift_buffer (live) #626

merged 1 commit into from
Apr 8, 2021

Conversation

matthuisman
Copy link
Contributor

@matthuisman matthuisman commented Mar 31, 2021

Fixes: d21spike/plugin.video.sling#22 (also needs PR: #564)

With the below MPD, currently IA will set the stream to VOD when it is actually LIVE

<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dvb="urn:dvb:dash:dash-extensions:2014-1" xmlns:move="http://www.movenetworks.com/dash/v1" xmlns:ms="urn:microsoft" xmlns:XMLSchema-instance="http://www.w3.org/2001/XMLSchema-instance" XMLSchema-instance:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" maxSegmentDuration="PT2.048000S" minBufferTime="PT2.048000S" publishTime="2020-12-07T20:30:00Z" type="dynamic" minimumUpdatePeriod="PT2.048000S" availabilityStartTime="2020-12-07T20:30:15Z" mediaPresentationDuration="PT9000.000000S" suggestedPresentationDelay="PT4.096000S">

This is because "mediaPresentationDuration" comes after "type".
mediaPresentationDuration sets bStatic to true

So, currently it goes

  1. "type"="dynamic" which makes bStatic = false
  2. "mediaPresentationDuration" which sets bStatic = true
  3. dash->has_timeshift_buffer_ is set to NOT bStatic = false
  4. IA think it's VOD

The order or attributes should be irrelevant.

With this PR, VOD is default and it's ever only setting LIVE to true when either dynamic or timeShiftBufferDepth found
It doesn't unset LIVE.

@Fireblade89
Copy link

I've been waiting for this for a long time. I can't wait to test it !

@glennguy
Copy link
Contributor

glennguy commented Apr 1, 2021

Looks good. mediaPresentationDuration doesn't imply VOD at all, it can be in either VOD or live. The guidelines are slightly ambiguous on this (mentions MPD 'may' be present in the context of static playlists, however doesn't explicitly mention them under dynamic playlist heading) which may have lead to the current interpretation

@matthuisman
Copy link
Contributor Author

matthuisman commented Apr 1, 2021

That's what I read as well. timeShiftBufferDepth is only present with dynamic (live) so is a good identifier as well.

We could also check profiles for is-off-live. But profiles can list multiple profiles. And I couldn't see a c++ function to search within a const chr. We would need to convert to std:string then find on that. Maybe something we can do in the future if we find live manifests not using type and not using timeshiftbuffer

@@ -128,4 +134,4 @@ TEST_F(DASHTreeTest, CalculateCorrectSegmentNumbersFromSegmentTimeline)
EXPECT_EQ(segments.size(), 13);
EXPECT_EQ(segments[0]->range_end_, 487050);
EXPECT_EQ(segments[12]->range_end_, 487062);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line required

@matthuisman
Copy link
Contributor Author

matthuisman commented Apr 8, 2021

@phunkyfish conflict fixed. New line added.added a 2nd test. squashed into a single commit

Copy link
Contributor

@phunkyfish phunkyfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phunkyfish phunkyfish merged commit 0bf53ec into xbmc:Matrix Apr 8, 2021
@matthuisman matthuisman deleted the vod_live_fix branch April 8, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Channels not playing "Live"
4 participants