summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2017-03-06 08:53:00 -0300
committerThibault Saunier <thibault.saunier@osg.samsung.com>2017-03-06 12:19:16 -0300
commite570d1e08009992a0dd6a24bb4cda4427b2b460f (patch)
tree70e9d018e8036ad2f0a7afa57f73e95c85e6adfd
parent50c98bae24c30c5c5d7c47dc4f7740a50ebbd585 (diff)
timeline: Return FALSE when commiting an empty timeline
Meaning that ASYNC_DONE/COMMITED is always emited when TRUE is returned
-rw-r--r--ges/ges-timeline.c7
-rw-r--r--tests/check/ges/backgroundsource.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c
index 7e8010bc..a72b088d 100644
--- a/ges/ges-timeline.c
+++ b/ges/ges-timeline.c
@@ -3368,6 +3368,9 @@ ges_timeline_commit_unlocked (GESTimeline * timeline)
GST_DEBUG_OBJECT (timeline, "commiting changes");
+ if (ges_timeline_is_empty (timeline))
+ return FALSE;
+
for (tmp = timeline->layers; tmp; tmp = tmp->next) {
GESLayer *layer = tmp->data;
@@ -3425,7 +3428,9 @@ ges_timeline_commit_unlocked (GESTimeline * timeline)
* for the signal.
*
* 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
ges_timeline_commit (GESTimeline * timeline)
diff --git a/tests/check/ges/backgroundsource.c b/tests/check/ges/backgroundsource.c
index d32448d5..693f5617 100644
--- a/tests/check/ges/backgroundsource.c
+++ b/tests/check/ges/backgroundsource.c
@@ -104,7 +104,7 @@ GST_START_TEST (test_test_source_properties)
/* Test mute support */
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,
120, 510, MIN_NLE_PRIO + TRANSITIONS_HEIGHT, FALSE);
g_object_set (clip, "mute", FALSE, NULL);