From d7c87910c297c200151127e2fdc081e437923e82 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Thu, 30 Aug 2018 17:44:07 +0100 Subject: [PATCH] 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 --- libs/gst/base/gstbaseparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 1830796d40..6b153be136 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -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)