g_option_context_add_main_entries (ctx, options, NULL);
g_option_context_add_group (ctx, gst_init_get_option_group ());
- if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
+#ifdef G_OS_WIN32
+ if (!g_option_context_parse_strv (ctx, &argv, &err))
+#else
+ if (!g_option_context_parse (ctx, &argc, &argv, &err))
+#endif
+ {
g_print ("Error initializing: %s\n", GST_STR_NULL (err->message));
g_clear_error (&err);
g_option_context_free (ctx);
return 1;
}
+#ifdef G_OS_WIN32
+ argc = g_strv_length (argv);
+#endif
+
gst_pb_utils_init ();
if (settings.list) {
int
main (int argc, char *argv[])
{
+ int ret;
+
+#ifdef G_OS_WIN32
+ argv = g_win32_get_command_line ();
+#endif
+
#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
- return gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
+ ret = gst_macos_main ((GstMainFunc) real_main, argc, argv, NULL);
#else
- return real_main (argc, argv);
+ ret = real_main (argc, argv);
#endif
+
+#ifdef G_OS_WIN32
+ g_strfreev (argv);
+#endif
+
+ return ret;
}