From f263bdcb2b4dbb5a5d7453645e0f58ef23c451e1 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: --- libs/gst/base/gstbaseparse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 761dd8aac6..cd7b3cf61a 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/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;