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
This commit is contained in:
Thiago Santos 2013-07-03 19:11:45 -03:00
parent 3030c25aed
commit 9a38127467

View file

@ -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;
}