mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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/4322>
This commit is contained in:
parent
b2feff23bc
commit
cb08a6d8dc
8 changed files with 32 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -2187,6 +2187,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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue