tools: Count argc after parsing GOption on Windows

Existing codes rely on modified argc value by g_option_context_parse()
but g_option_context_parse_strv() is used in case of Windows.
Count arguments after the option parsing manually.
Fixing command "gst-inspect-1.0.exe -b"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4313>
This commit is contained in:
Seungha Yang 2023-03-31 04:40:58 +09:00 committed by GStreamer Marge Bot
parent 6bb1257c99
commit 55db8367f7
8 changed files with 32 additions and 0 deletions

View file

@ -373,6 +373,10 @@ real_main (int argc, char *argv[])
g_option_context_free (ctx);
return 1;
}
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
gst_pb_utils_init ();
if (settings.list) {

View file

@ -337,6 +337,10 @@ real_main (int argc, char **argv)
}
g_option_context_free (ctx);
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
GST_DEBUG_CATEGORY_INIT (devmon_debug, "device-monitor", 0,
"gst-device-monitor");

View file

@ -685,6 +685,10 @@ real_main (int argc, char **argv)
g_option_context_free (ctx);
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
if (argc < 2) {
g_print ("usage: %s <uris>\n", argv[0]);
exit (-1);

View file

@ -1711,6 +1711,10 @@ real_main (int argc, char **argv)
}
g_option_context_free (ctx);
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
GST_DEBUG_CATEGORY_INIT (play_debug, "play", 0, "gst-play");
if (print_version) {

View file

@ -2189,6 +2189,10 @@ real_main (int argc, char *argv[])
gst_init (&argc, &argv);
#endif
#if defined(G_OS_WIN32) && !defined(GST_CHECK_MAIN)
argc = g_strv_length (argv);
#endif
gst_tools_print_version ();
if (print_all && argc > 1) {

View file

@ -1178,6 +1178,10 @@ real_main (int argc, char *argv[])
gst_init (&argc, &argv);
#endif
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
gst_tools_print_version ();
#ifdef G_OS_UNIX

View file

@ -1301,6 +1301,10 @@ main (gint argc, gchar * argv[])
}
g_option_context_free (ctx);
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
gst_tools_print_version ();
if (filenames == NULL || *filenames == NULL) {

View file

@ -177,6 +177,10 @@ real_main (int argc, char *argv[])
}
g_option_context_free (ctx);
#ifdef G_OS_WIN32
argc = g_strv_length (argv);
#endif
gst_tools_print_version ();
if (filenames == NULL || *filenames == NULL) {