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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1285>
This commit is contained in:
Pascal Hache 2021-10-22 11:00:06 -04:00 committed by GStreamer Marge Bot
parent 516f9592e7
commit f263bdcb2b

View file

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