From: <mn...@ke...> - 2011-01-28 11:51:47
|
Module: gst-plugins-bad Branch: master Commit: b97e560f1a77b3bed546e937bb02e0a4a73b2b31 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=b97e560f1a77b3bed546e937bb02e0a4a73b2b31 Author: Mark Nauwelaerts <mar...@co...> Date: Tue Jan 11 15:23:29 2011 +0100 baseparse: need proper frame duration to obtain sensible frame bitrate --- gst/audioparsers/gstbaseparse.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 00b9649..a0319d8 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -1206,7 +1206,10 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame) 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, parse->priv->avg_bitrate); |