summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-04 13:36:05 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-04 13:36:05 +0200
commit64a2dcf582b8775a3cb7db730df0f94c0331ab58 (patch)
treea4c82ad3a28b540c35bd7ce83c42ef480f4f3d46
parentf9ada426d4762e01ca86da4314aa936d906466b7 (diff)
mpdparse: Clamp seek times to the availabilityStartTime
Otherwise we will seek to negative times, which are interpreted as unsigned integers later.
-rw-r--r--ext/dash/gstmpdparser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c
index f7213d88d..6f3927565 100644
--- a/ext/dash/gstmpdparser.c
+++ b/ext/dash/gstmpdparser.c
@@ -4534,6 +4534,10 @@ gst_mpd_client_seek_to_time (GstMpdClient * client, GDateTime * time)
ts_microseconds = g_date_time_difference (time, start);
g_date_time_unref (start);
+ /* Clamp to availability start time, otherwise calculations wrap around */
+ if (ts_microseconds < 0)
+ ts_microseconds = 0;
+
ts = ts_microseconds * GST_USECOND;
for (stream = client->active_streams; stream; stream = g_list_next (stream)) {
ret = ret & gst_mpd_client_stream_seek (client, stream->data, ts);