From 8eb87ce5dc69f44ffe539eb617c27bd389d39ec0 Mon Sep 17 00:00:00 2001 From: Wojciech Przybyl Date: Fri, 1 Apr 2016 17:42:32 +0100 Subject: [PATCH] dashdemux: fix default suggestedPresentationDelay When MPD@suggestedPresentationDelay is not present in the MPD, dashdemux can provide default suggestedPresentationDelay. However when applying default value of suggestedPresentationDelay, the value should be subtracted from current time, not added to it. When streams setup is performed and live point is calculated, we have to go to the wall clock (current time) minus suggestedPresentationDelay, if we tried to start with current time plus suggestedPresentationDelay, we would be asking for future stream, which has not yet been recorded. Also the value needs to be converted from ms to us. https://bugzilla.gnome.org/show_bug.cgi?id=764726 --- ext/dash/gstdashdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 2f34148671..d46a0cb270 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -823,7 +823,8 @@ gst_dash_demux_setup_streams (GstAdaptiveDemux * demux) gint64 dfp = gst_mpd_client_parse_default_presentation_delay (dashdemux->client, dashdemux->default_presentation_delay); - GstDateTime *target = gst_mpd_client_add_time_difference (now, dfp); + GstDateTime *target = gst_mpd_client_add_time_difference (now, + dfp * -1000); gst_date_time_unref (now); now = target; }