Commit e35adf5b authored by Philippe Normand's avatar Philippe Normand 🥑

baseparse: avg_bitrate calculation critical warning fix

The avg_bitrate is an unsigned int, so the gst_util_uin64_scale() function can't
be used for it, as it expects signed integers for the fraction parts arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=797054
parent f6739d8e
......@@ -1821,7 +1821,7 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame)
if (avg_bitrate > G_MAXUINT)
return;
parse->priv->avg_bitrate = avg_bitrate;
parse->priv->avg_bitrate = (guint) avg_bitrate;
} else {
/* No way to figure out frame duration (is this even possible?) */
return;
......@@ -1872,7 +1872,7 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame)
/* Only update the tag on a 2% change */
if (parse->priv->post_avg_bitrate && parse->priv->avg_bitrate) {
guint64 diffprev = gst_util_uint64_scale_int (100,
guint64 diffprev = gst_util_uint64_scale (100,
ABSDIFF (parse->priv->avg_bitrate, parse->priv->posted_avg_bitrate),
parse->priv->avg_bitrate);
if (diffprev >= UPDATE_THRESHOLD)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment