dash: mpdclient: fix divide by 0 if segment has no duration

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4436>
This commit is contained in:
Guillaume Desmottes 2023-04-17 11:36:55 +02:00 committed by GStreamer Marge Bot
parent 53dc1b96e2
commit 901383771d
2 changed files with 2 additions and 2 deletions

View file

@ -1768,7 +1768,7 @@ gst_mpd_client_stream_seek (GstMPDClient * client, GstActiveStream * stream,
g_return_val_if_fail (GST_MPD_MULT_SEGMENT_BASE_NODE
(stream->cur_seg_template)->SegmentTimeline == NULL, FALSE);
if (!GST_CLOCK_TIME_IS_VALID (duration)) {
if (!GST_CLOCK_TIME_IS_VALID (duration) || duration == 0) {
return FALSE;
}

View file

@ -1775,7 +1775,7 @@ gst_mpd_client2_stream_seek (GstMPDClient2 * client, GstActiveStream * stream,
g_return_val_if_fail (GST_MPD_MULT_SEGMENT_BASE_NODE
(stream->cur_seg_template)->SegmentTimeline == NULL, FALSE);
if (!GST_CLOCK_TIME_IS_VALID (duration)) {
if (!GST_CLOCK_TIME_IS_VALID (duration) || duration == 0) {
return FALSE;
}