From: Mathieu Duponchelle Date: Fri, 2 May 2014 12:17:07 +0000 (+0200) Subject: ges-launch: Only create a layer if needed. X-Git-Tag: 1.19.3~493^2~1593 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f16ad15ef359ebcec4312ef58dfad3f87502bc19;p=platform%2Fupstream%2Fgstreamer.git ges-launch: Only create a layer if needed. That way scenarios can start with an empty timeline --- diff --git a/tools/ges-launch.c b/tools/ges-launch.c index a928656..52066d2 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -254,7 +254,7 @@ str_to_time (char *time) static GESTimeline * create_timeline (int nbargs, gchar ** argv, const gchar * proj_uri) { - GESLayer *layer; + GESLayer *layer = NULL; GESTrack *tracka = NULL, *trackv = NULL; GESTimeline *timeline; guint i; @@ -276,13 +276,6 @@ create_timeline (int nbargs, gchar ** argv, const gchar * proj_uri) if (proj_uri) return timeline; - /* We are only going to be doing one layer of clips */ - layer = (GESLayer *) ges_layer_new (); - - /* Add the tracks and the layer to the timeline */ - if (!ges_timeline_add_layer (timeline, layer)) - goto build_failure; - if (track_types & GES_TRACK_TYPE_AUDIO) { tracka = GES_TRACK (ges_audio_track_new ()); if (disable_mixing) @@ -312,6 +305,15 @@ create_timeline (int nbargs, gchar ** argv, const gchar * proj_uri) char *arg0 = argv[(i * 3) + 1]; guint64 duration = str_to_time (argv[(i * 3) + 2]); + if (i == 0) { + /* We are only going to be doing one layer of clips */ + layer = (GESLayer *) ges_layer_new (); + + /* Add the tracks and the layer to the timeline */ + if (!ges_timeline_add_layer (timeline, layer)) + goto build_failure; + } + if (duration == 0) duration = GST_CLOCK_TIME_NONE;