From 64a2dcf582b8775a3cb7db730df0f94c0331ab58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 4 Jun 2015 13:36:05 +0200 Subject: [PATCH] mpdparse: Clamp seek times to the availabilityStartTime Otherwise we will seek to negative times, which are interpreted as unsigned integers later. --- ext/dash/gstmpdparser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index f7213d88d2..6f3927565b 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);