diff --git a/ges/ges-clip.c b/ges/ges-clip.c index 11b58ee63d..52d7578b92 100644 --- a/ges/ges-clip.c +++ b/ges/ges-clip.c @@ -486,6 +486,15 @@ _add_child (GESContainer * container, GESTimelineElement * element) g_return_val_if_fail (GES_IS_TRACK_ELEMENT (element), FALSE); + if (element->timeline + && element->timeline != GES_TIMELINE_ELEMENT_TIMELINE (container)) { + GST_WARNING_OBJECT (container, "Can not add the child %" GES_FORMAT + " because its timeline is %" GST_PTR_FORMAT " rather than the " + "clip's timeline %" GST_PTR_FORMAT, GES_ARGS (element), + element->timeline, GES_TIMELINE_ELEMENT_TIMELINE (container)); + return FALSE; + } + /* NOTE: notifies are currently frozen by ges_container_add */ _get_priority_range (container, &min_prio, &max_prio); if (ELEMENT_FLAG_IS_SET (element, GES_TRACK_ELEMENT_IS_CORE)) { diff --git a/tests/check/ges/clip.c b/tests/check/ges/clip.c index 0cc00ccb28..16ded049b8 100644 --- a/tests/check/ges/clip.c +++ b/tests/check/ges/clip.c @@ -588,6 +588,12 @@ GST_START_TEST (test_clip_find_track_element) fail_unless (ges_timeline_add_track (timeline, track1)); fail_unless (ges_timeline_add_track (timeline, track2)); + /* need to register the clip with the timeline */ + /* FIXME: we should make the clip part of a layer, but the current + * default select-tracks-for-object signal is broken for multiple + * tracks. In fact, we should be using this signal in this test */ + ges_timeline_element_set_timeline (GES_TIMELINE_ELEMENT (clip), timeline); + effect = GES_TRACK_ELEMENT (ges_effect_new ("identity")); fail_unless (ges_track_add_element (track, effect)); fail_unless (ges_container_add (GES_CONTAINER (clip),