From a7a2623166ec907d92842a09e6dbb2ef5369b9fb Mon Sep 17 00:00:00 2001 From: Hoonhee Lee Date: Sat, 20 Aug 2016 08:54:27 +0900 Subject: [PATCH] streams: update and emit notify signal only if taglist actually changed https://bugzilla.gnome.org/show_bug.cgi?id=770161 --- gst/gststreams.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gst/gststreams.c b/gst/gststreams.c index de8c244..28741d8 100644 --- a/gst/gststreams.c +++ b/gst/gststreams.c @@ -353,11 +353,19 @@ gst_stream_get_stream_type (GstStream * stream) void gst_stream_set_tags (GstStream * stream, GstTagList * tags) { + gboolean notify = FALSE; + GST_OBJECT_LOCK (stream); - gst_mini_object_replace ((GstMiniObject **) & stream->priv->tags, - (GstMiniObject *) tags); + if (stream->priv->tags == NULL || tags == NULL + || !gst_tag_list_is_equal (stream->priv->tags, tags)) { + gst_mini_object_replace ((GstMiniObject **) & stream->priv->tags, + (GstMiniObject *) tags); + notify = TRUE; + } GST_OBJECT_UNLOCK (stream); - g_object_notify_by_pspec (G_OBJECT (stream), gst_stream_pspecs[PROP_TAGS]); + + if (notify) + g_object_notify_by_pspec (G_OBJECT (stream), gst_stream_pspecs[PROP_TAGS]); } /** -- 2.7.4