timeline: Return FALSE when commiting an empty timeline

Meaning that ASYNC_DONE/COMMITED is always emited when TRUE is returned
This commit is contained in:
Thibault Saunier 2017-03-06 08:53:00 -03:00
parent 50c98bae24
commit e570d1e080
2 changed files with 7 additions and 2 deletions

View file

@ -3368,6 +3368,9 @@ ges_timeline_commit_unlocked (GESTimeline * timeline)
GST_DEBUG_OBJECT (timeline, "commiting changes"); GST_DEBUG_OBJECT (timeline, "commiting changes");
if (ges_timeline_is_empty (timeline))
return FALSE;
for (tmp = timeline->layers; tmp; tmp = tmp->next) { for (tmp = timeline->layers; tmp; tmp = tmp->next) {
GESLayer *layer = tmp->data; GESLayer *layer = tmp->data;
@ -3425,7 +3428,9 @@ ges_timeline_commit_unlocked (GESTimeline * timeline)
* for the signal. * for the signal.
* *
* Returns: %TRUE if pending changes were commited or %FALSE if nothing needed * Returns: %TRUE if pending changes were commited or %FALSE if nothing needed
* to be commited * to be commited. This means that if %FALSE is returned then no "commited" signal
* will be emited.
*
*/ */
gboolean gboolean
ges_timeline_commit (GESTimeline * timeline) ges_timeline_commit (GESTimeline * timeline)

View file

@ -104,7 +104,7 @@ GST_START_TEST (test_test_source_properties)
/* Test mute support */ /* Test mute support */
g_object_set (clip, "mute", TRUE, NULL); g_object_set (clip, "mute", TRUE, NULL);
fail_unless (ges_timeline_commit (timeline)); fail_if (ges_timeline_commit (timeline));
nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_NLE_PRIO + TRANSITIONS_HEIGHT, FALSE); 120, 510, MIN_NLE_PRIO + TRANSITIONS_HEIGHT, FALSE);
g_object_set (clip, "mute", FALSE, NULL); g_object_set (clip, "mute", FALSE, NULL);