tools: Fix compilation if option parsing is disabled

Fixes bug #587976.
This commit is contained in:
Philip Jägenstedt 2009-07-08 15:15:04 +02:00 committed by Sebastian Dröge
parent 5f6bfb816b
commit 9501767704
2 changed files with 12 additions and 0 deletions

View file

@ -1403,6 +1403,7 @@ main (int argc, char *argv[])
gboolean plugin_name = FALSE;
gboolean print_aii = FALSE;
gboolean uri_handlers = FALSE;
#ifndef GST_DISABLE_OPTION_PARSING
GOptionEntry options[] = {
{"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
N_("Print all elements"), NULL},
@ -1422,6 +1423,7 @@ main (int argc, char *argv[])
};
GOptionContext *ctx;
GError *err = NULL;
#endif
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
@ -1432,6 +1434,7 @@ main (int argc, char *argv[])
if (!g_thread_supported ())
g_thread_init (NULL);
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
g_option_context_add_group (ctx, gst_init_get_option_group ());
@ -1440,6 +1443,9 @@ main (int argc, char *argv[])
exit (1);
}
g_option_context_free (ctx);
#else
gst_init (&argc, &argv);
#endif
gst_tools_print_version ("gst-inspect");

View file

@ -666,6 +666,7 @@ main (int argc, char *argv[])
gboolean eos_on_shutdown = FALSE;
gchar *savefile = NULL;
gchar *exclude_args = NULL;
#ifndef GST_DISABLE_OPTION_PARSING
GOptionEntry options[] = {
{"tags", 't', 0, G_OPTION_ARG_NONE, &tags,
N_("Output tags (also known as metadata)"), NULL},
@ -692,6 +693,7 @@ main (int argc, char *argv[])
};
GOptionContext *ctx;
GError *err = NULL;
#endif
gchar **argvn;
GError *error = NULL;
gint res = 0;
@ -709,6 +711,7 @@ main (int argc, char *argv[])
gst_alloc_trace_set_flags_all (GST_ALLOC_TRACE_LIVE);
#ifndef GST_DISABLE_OPTION_PARSING
ctx = g_option_context_new ("PIPELINE-DESCRIPTION");
g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
g_option_context_add_group (ctx, gst_init_get_option_group ());
@ -720,6 +723,9 @@ main (int argc, char *argv[])
exit (1);
}
g_option_context_free (ctx);
#else
gst_init (&argc, &argv);
#endif
gst_tools_print_version ("gst-launch");