mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
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
This commit is contained in:
parent
89e2a69d37
commit
2b9606437c
1 changed files with 8 additions and 3 deletions
|
@ -843,15 +843,18 @@ ges_clip_create_track_elements_func (GESClip * clip, GESTrackType type)
|
||||||
void
|
void
|
||||||
ges_clip_set_layer (GESClip * clip, GESLayer * layer)
|
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;
|
clip->priv->layer = layer;
|
||||||
|
|
||||||
|
GST_DEBUG ("clip:%p, layer:%p", clip, layer);
|
||||||
|
|
||||||
/* We do not want to notify the setting of layer = NULL when
|
/* 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
|
* 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
|
* that it will be added to another layer right after, and this
|
||||||
* is what imports here.) */
|
* 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]);
|
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;
|
clip->priv->is_moving = FALSE;
|
||||||
|
|
||||||
gst_object_unref (clip);
|
gst_object_unref (clip);
|
||||||
|
g_object_notify_by_pspec (G_OBJECT (clip), properties[PROP_LAYER]);
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
return ret && (clip->priv->layer == layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue