mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-27 16:55:05 +00:00
avidemux: Ensure _calculate_durations_from_index only uses valid streams
This commit is contained in:
parent
1936d6ed26
commit
a6ed612f42
|
@ -2684,7 +2684,7 @@ gst_avi_demux_calculate_durations_from_index (GstAviDemux * avi)
|
||||||
gst_riff_strh *strh;
|
gst_riff_strh *strh;
|
||||||
|
|
||||||
stream = &avi->stream[i];
|
stream = &avi->stream[i];
|
||||||
if (G_UNLIKELY (!stream || !(strh = stream->strh)))
|
if (G_UNLIKELY (!stream || !stream->idx_n || !(strh = stream->strh)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* get header duration for the stream */
|
/* get header duration for the stream */
|
||||||
|
@ -2701,11 +2701,14 @@ gst_avi_demux_calculate_durations_from_index (GstAviDemux * avi)
|
||||||
/* fall back to header info to calculate a duration */
|
/* fall back to header info to calculate a duration */
|
||||||
duration = hduration;
|
duration = hduration;
|
||||||
}
|
}
|
||||||
|
GST_INFO ("Setting duration of stream #%d to %" GST_TIME_FORMAT,
|
||||||
|
i, GST_TIME_ARGS (duration));
|
||||||
/* set duration for the stream */
|
/* set duration for the stream */
|
||||||
stream->duration = duration;
|
stream->duration = duration;
|
||||||
|
|
||||||
/* find total duration */
|
/* find total duration */
|
||||||
if (total == GST_CLOCK_TIME_NONE || duration > total)
|
if (total == GST_CLOCK_TIME_NONE ||
|
||||||
|
(GST_CLOCK_TIME_IS_VALID (duration) && duration > total))
|
||||||
total = duration;
|
total = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue