From 2b9606437cf1e698b6b11165d8f13490b151af29 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 2 Jul 2013 19:47:48 -0400 Subject: [PATCH] clip: Emit the notify::layer signal only when actually needed That means: - only when we do change layer - At the end of moving between two layers --- ges/ges-clip.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ges/ges-clip.c b/ges/ges-clip.c index 2ceef383f7..66e764df5c 100644 --- a/ges/ges-clip.c +++ b/ges/ges-clip.c @@ -843,15 +843,18 @@ ges_clip_create_track_elements_func (GESClip * clip, GESTrackType type) void ges_clip_set_layer (GESClip * clip, GESLayer * layer) { - GST_DEBUG ("clip:%p, layer:%p", clip, layer); + if (layer == clip->priv->layer) + return; clip->priv->layer = layer; + GST_DEBUG ("clip:%p, layer:%p", clip, layer); + /* We do not want to notify the setting of layer = NULL when * it is actually the result of a move between layer (as we know * that it will be added to another layer right after, and this * is what imports here.) */ - if (layer || clip->priv->is_moving == FALSE) + if (layer && !clip->priv->is_moving) g_object_notify_by_pspec (G_OBJECT (clip), properties[PROP_LAYER]); } @@ -980,8 +983,10 @@ ges_clip_move_to_layer (GESClip * clip, GESLayer * layer) clip->priv->is_moving = FALSE; gst_object_unref (clip); + g_object_notify_by_pspec (G_OBJECT (clip), properties[PROP_LAYER]); - return ret; + + return ret && (clip->priv->layer == layer); } /**