From 39e21bb6dd79e467ff747ab93b19078f03d03646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 24 Aug 2017 16:00:42 +0100 Subject: [PATCH] baseparse: fix taglist update spam We would constantly re-post the taglist because posted_avg_rate only gets set to avg_bitrate if parse->priv->post_avg_bitrate is true, so if it's false the posted rate will always differ from the current average rate and we'd queue an update, which leads to us spamming downstream and the application with taglist updates. Fix this by only queuing an update if the average rate will actually be posted. These taglists updates could cause expensive operations on the application side, e.g. in Totem. https://bugzilla.gnome.org/show_bug.cgi?id=786561 --- libs/gst/base/gstbaseparse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 8da034bd8a..34e85b1125 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -1823,7 +1823,8 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame) if (parse->priv->bitrate) { parse->priv->avg_bitrate = parse->priv->bitrate; /* spread this (confirmed) info ASAP */ - if (parse->priv->posted_avg_bitrate != parse->priv->avg_bitrate) + if (parse->priv->post_avg_bitrate && + parse->priv->posted_avg_bitrate != parse->priv->avg_bitrate) parse->priv->tags_changed = TRUE; }