baseparse: need proper frame duration to obtain sensible frame bitrate

This commit is contained in:
Mark Nauwelaerts 2011-01-11 15:23:29 +01:00 committed by Tim-Philipp Müller
parent ebf124251f
commit 212eae966a

View file

@ -1206,7 +1206,10 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame)
gst_base_parse_post_bitrates (parse, FALSE, TRUE, FALSE); gst_base_parse_post_bitrates (parse, FALSE, TRUE, FALSE);
} }
frame_bitrate = (8 * data_len * GST_SECOND) / frame_dur; if (frame_dur)
frame_bitrate = (8 * data_len * GST_SECOND) / frame_dur;
else
return;
GST_LOG_OBJECT (parse, "frame bitrate %u, avg bitrate %u", frame_bitrate, GST_LOG_OBJECT (parse, "frame bitrate %u, avg bitrate %u", frame_bitrate,
parse->priv->avg_bitrate); parse->priv->avg_bitrate);