ges: launch: Enhance the way we detect explicitly added track

When using subtimeline serialized with the command line formatter
syntax, we had a false positive when detecting if the user had explicitly
specified tracks with the `+track` syntax. Verifying the presence of
`+track` explicitly in the `args` array ensure the `+track` is not for
a subtimeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5981>
This commit is contained in:
Thibault Saunier 2023-06-22 22:59:50 -04:00 committed by GStreamer Marge Bot
parent 8d58d2b43b
commit 4c8396da8e

View file

@ -95,6 +95,7 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts)
gchar *prev_arg = NULL; gchar *prev_arg = NULL;
GString *track_def; GString *track_def;
GString *timeline_str; GString *timeline_str;
gboolean adds_tracks = FALSE;
gchar *string = g_strdup (" "); gchar *string = g_strdup (" ");
@ -104,6 +105,8 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts)
new_string = g_strconcat (string, " ", sanitized, NULL); new_string = g_strconcat (string, " ", sanitized, NULL);
adds_tracks |= (g_strcmp0 (args[i], "+track") == 0);
g_free (sanitized); g_free (sanitized);
g_free (string); g_free (string);
string = new_string; string = new_string;
@ -116,7 +119,7 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts)
return NULL; return NULL;
} }
if (strstr (string, "+track")) { if (adds_tracks) {
gchar *res = g_strconcat ("ges:", string, NULL); gchar *res = g_strconcat ("ges:", string, NULL);
g_free (string); g_free (string);