From 4c8396da8ea73f88325bd6de20b610134c7256b5 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 22 Jun 2023 22:59:50 -0400 Subject: [PATCH] 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: --- subprojects/gst-editing-services/tools/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-editing-services/tools/utils.c b/subprojects/gst-editing-services/tools/utils.c index 0a84672843..3fef2c9b93 100644 --- a/subprojects/gst-editing-services/tools/utils.c +++ b/subprojects/gst-editing-services/tools/utils.c @@ -95,6 +95,7 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts) gchar *prev_arg = NULL; GString *track_def; GString *timeline_str; + gboolean adds_tracks = FALSE; gchar *string = g_strdup (" "); @@ -104,6 +105,8 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts) new_string = g_strconcat (string, " ", sanitized, NULL); + adds_tracks |= (g_strcmp0 (args[i], "+track") == 0); + g_free (sanitized); g_free (string); string = new_string; @@ -116,7 +119,7 @@ sanitize_timeline_description (gchar ** args, GESLauncherParsedOptions * opts) return NULL; } - if (strstr (string, "+track")) { + if (adds_tracks) { gchar *res = g_strconcat ("ges:", string, NULL); g_free (string);