camerabin2: examples: Backport fix from camerabin example

We should only check if the xwindow should be created if we already
parsed the arguments of the program
This commit is contained in:
Thiago Santos 2011-02-09 08:15:08 -03:00
parent b3abf91232
commit 7847f6497b

View file

@ -694,10 +694,6 @@ main (int argc, char *argv[])
GOptionContext *ctx;
GError *err = NULL;
/* if we fail to create xwindow should we care? */
if (!no_xwindow)
create_host_window ();
if (!g_thread_supported ())
g_thread_init (NULL);
@ -713,6 +709,10 @@ main (int argc, char *argv[])
GST_DEBUG_CATEGORY_INIT (camerabin_test, "camerabin-test", 0,
"camerabin test");
/* if we fail to create xwindow should we care? */
if (!no_xwindow)
create_host_window ();
/* FIXME: error handling */
if (ev_option != NULL)
ev_compensation = strtod (ev_option, (char **) NULL);