From d4762346f5a768d1a701688613f7cd31e4f400a3 Mon Sep 17 00:00:00 2001 From: Pascal Hache Date: Fri, 22 Oct 2021 11:00:06 -0400 Subject: [PATCH] baseparse: fix invalid avg_bitrate after reset 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: --- subprojects/gstreamer/libs/gst/base/gstbaseparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gstreamer/libs/gst/base/gstbaseparse.c b/subprojects/gstreamer/libs/gst/base/gstbaseparse.c index b08a284..dfdb2a3 100644 --- a/subprojects/gstreamer/libs/gst/base/gstbaseparse.c +++ b/subprojects/gstreamer/libs/gst/base/gstbaseparse.c @@ -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; -- 2.7.4