From 9a38127467b5cf0a8920c704d414acdadecd288e Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 3 Jul 2013 19:11:45 -0300 Subject: [PATCH] dashdemux: prevent assertion when duration is unknown Duration from segment being unknown is a issue from the MPD and not a programming issue, so the assert isn't useful here. Instead check and return an error code so the caller can fallback to alternatives --- ext/dash/gstmpdparser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index e9fb433..94c8f4c 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -3566,7 +3566,8 @@ gst_mpd_client_get_segment_index_at_time (GstMpdClient * client, /* TODO: Assumes all fragments are roughly the same duration */ seg_duration = gst_mpd_client_get_next_fragment_duration (client, stream); - g_assert (seg_duration > 0); + if (seg_duration == 0) + return -1; return diff / seg_duration; } -- 2.7.4