audioparse: fix possible division-by-zero

https://bugzilla.gnome.org/show_bug.cgi?id=635786
This commit is contained in:
Andoni Morales Alastruey 2010-11-25 17:14:23 +01:00 committed by Tim-Philipp Müller
parent a45019fdd6
commit 5bfc92714e

View file

@ -1131,7 +1131,7 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBuffer * buffer)
/* duration should be valid by now,
* either set by subclass or maybe based on fps settings */
if (GST_BUFFER_DURATION_IS_VALID (buffer)) {
if (GST_BUFFER_DURATION_IS_VALID (buffer) && parse->priv->acc_duration != 0) {
/* Calculate duration of a frame from buffer properties */
frame_dur = GST_BUFFER_DURATION (buffer);
parse->priv->avg_bitrate = (8 * parse->priv->data_bytecount * GST_SECOND) /