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
This commit is contained in:
Philippe Normand 2018-08-30 17:44:07 +01:00
parent 95fcced84d
commit d7c87910c2

View file

@ -1863,7 +1863,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;
@ -1914,7 +1914,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)