From 0bed9a6646c58e1aa92e54f163d740e73b6ddd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Wed, 23 Jan 2013 13:20:25 -0500 Subject: [PATCH] dashdemux: don't wait for the whole duration of a fragment when seeking --- ext/dash/gstdashdemux.c | 6 ++++-- ext/dash/gstdashdemux.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index fe79c5ecd9..6bfeeb4eda 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1030,16 +1030,18 @@ gst_dash_demux_stream_loop (GstDashDemux * demux) goto error_pushing; } demux->need_segment = FALSE; + demux->last_position_shift = demux->position_shift; demux->position_shift = 0; g_list_free (listfragment); if (GST_STATE (demux) == GST_STATE_PLAYING) { /* Wait for the duration of a fragment before resuming this task */ g_get_current_time (&demux->next_push); g_time_val_add (&demux->next_push, - gst_mpd_client_get_next_fragment_duration (demux->client) - / GST_SECOND * G_USEC_PER_SEC); + (gst_mpd_client_get_next_fragment_duration (demux->client) - + demux->last_position_shift) / GST_SECOND * G_USEC_PER_SEC); GST_DEBUG_OBJECT (demux, "Next push scheduled at %s", g_time_val_to_iso8601 (&demux->next_push)); + demux->last_position_shift = 0; } else { /* The pipeline is now set up, wait until playback begins */ goto pause_streaming; diff --git a/ext/dash/gstdashdemux.h b/ext/dash/gstdashdemux.h index 71509685c5..9508361f79 100644 --- a/ext/dash/gstdashdemux.h +++ b/ext/dash/gstdashdemux.h @@ -96,6 +96,7 @@ struct _GstDashDemux /* Position in the stream */ GstClockTime position; GstClockTime position_shift; + GstClockTime last_position_shift; gboolean need_segment; /* Download rate */ guint64 dnl_rate;