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
This commit is contained in:
Tim-Philipp Müller 2017-08-24 16:00:42 +01:00
parent 85e9f41439
commit 39e21bb6dd

View file

@ -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;
}