diff --git a/tools/ges-launcher.c b/tools/ges-launcher.c index 74685de651..c409f72396 100644 --- a/tools/ges-launcher.c +++ b/tools/ges-launcher.c @@ -103,7 +103,7 @@ _set_track_restriction_caps (GESTrack * track, const gchar * caps_str) caps = gst_caps_from_string (caps_str); if (!caps) { - g_printerr ("Could not create caps for %s from: %s", + g_error ("Could not create caps for %s from: %s", G_OBJECT_TYPE_NAME (track), caps_str); return FALSE; @@ -115,6 +115,22 @@ _set_track_restriction_caps (GESTrack * track, const gchar * caps_str) return TRUE; } +static void +_set_restriction_caps (GESTimeline * timeline, ParsedOptions * opts) +{ + GList *tmp, *tracks = ges_timeline_get_tracks (timeline); + + for (tmp = tracks; tmp; tmp = tmp->next) { + if (GES_TRACK (tmp->data)->type == GES_TRACK_TYPE_VIDEO) + _set_track_restriction_caps (tmp->data, opts->video_track_caps); + else if (GES_TRACK (tmp->data)->type == GES_TRACK_TYPE_AUDIO) + _set_track_restriction_caps (tmp->data, opts->audio_track_caps); + } + + g_list_free_full (tracks, gst_object_unref); + +} + static gboolean _timeline_set_user_options (GESLauncher * self, GESTimeline * timeline, const gchar * load_path) @@ -167,6 +183,8 @@ retry: if (!(ges_timeline_add_track (timeline, tracka))) return FALSE; } + } else { + _set_restriction_caps (timeline, opts); } return TRUE;