ges-launch: Only create a layer if needed.

That way scenarios can start with an empty timeline
This commit is contained in:
Mathieu Duponchelle 2014-05-02 14:17:07 +02:00
parent 5d21fb74fe
commit f16ad15ef3

View file

@ -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;