dash: do not use invalid stream duration
authorThiago Santos <thiagossantos@gmail.com>
Sat, 16 Jul 2016 18:29:42 +0000 (15:29 -0300)
committerThiago Santos <thiagossantos@gmail.com>
Thu, 20 Oct 2016 14:17:34 +0000 (11:17 -0300)
If it is is unknown, consider it infinite

https://bugzilla.gnome.org/show_bug.cgi?id=768460

ext/dash/gstmpdparser.c

index 387bb65..e6d7283 100644 (file)
@@ -3347,7 +3347,8 @@ gst_mpd_client_get_period_index_at_time (GstMpdClient * client,
   for (idx = 0, iter = client->periods; iter; idx++, iter = g_list_next (iter)) {
     stream_period = iter->data;
     if (stream_period->start <= time_offset
-        && stream_period->start + stream_period->duration > time_offset) {
+        && (!GST_CLOCK_TIME_IS_VALID (stream_period->duration)
+            || stream_period->start + stream_period->duration > time_offset)) {
       period_idx = idx;
       break;
     }