pid = getpid ();
ret = proc_pidpath (pid, pathbuf, sizeof (pathbuf));
if (ret > 0)
- _gst_executable_path = g_strdup (pathbuf)
- }
+ _gst_executable_path = g_strdup (pathbuf);
+}
#else
static void
find_executable_path (void)
g_mutex_unlock (&init_lock);
return TRUE;
}
-
- find_executable_path ();
-
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("- GStreamer initialization");
g_option_context_set_ignore_unknown_options (ctx, TRUE);
return TRUE;
}
+ find_executable_path ();
+
_priv_gst_start_time = gst_util_get_timestamp ();
#ifndef GST_DISABLE_GST_DEBUG
char **my_argv;
int my_argc;
- if (argc != 3 || strcmp (argv[1], "-l"))
+ /* We may or may not have an executable path */
+ if (argc != 2 && argc != 3)
+ return 1;
+
+ if (strcmp (argv[1], "-l"))
return 1;
my_argc = 2;
_gst_disable_registry_cache = TRUE;
#endif
- _gst_executable_path = g_strdup (argv[2]);
+ if (argc == 3)
+ _gst_executable_path = g_strdup (argv[2]);
+
res = gst_init_check (&my_argc, &my_argv, NULL);
g_free (my_argv);