baseparse: fix invalid avg_bitrate after reset
authorPascal Hache <hacpa@touchtunes.com>
Fri, 22 Oct 2021 15:00:06 +0000 (11:00 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 22 Oct 2021 17:38:22 +0000 (17:38 +0000)
gst_base_parse_reset() does not reset data_bytecount to 0, so
gst_base_parse_update_bitrates() uses a wrong value to calculate
the average bitrate on subsequent pipeline starts. This leads to an
excessive amount of "tag" events being pushed. These events include
very high "bitrate" values that diminish over time, and are produced
until the average bitrate is back to sane values.

Fixes #840

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1228>

subprojects/gstreamer/libs/gst/base/gstbaseparse.c

index b08a284..dfdb2a3 100644 (file)
@@ -826,6 +826,7 @@ gst_base_parse_reset (GstBaseParse * parse)
   parse->priv->bitrate = 0;
   parse->priv->framecount = 0;
   parse->priv->bytecount = 0;
+  parse->priv->data_bytecount = 0;
   parse->priv->acc_duration = 0;
   parse->priv->first_frame_pts = GST_CLOCK_TIME_NONE;
   parse->priv->first_frame_dts = GST_CLOCK_TIME_NONE;