tests/examples/seek/seek.c: Include config.h and check if we have X. Fixes: #540334.
authorStefan Kost <ensonic@users.sourceforge.net>
Fri, 27 Jun 2008 07:42:07 +0000 (07:42 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Fri, 27 Jun 2008 07:42:07 +0000 (07:42 +0000)
Original commit message from CVS:
* tests/examples/seek/seek.c:
Include config.h and check if we have X. Fixes: #540334.

ChangeLog
tests/examples/seek/seek.c

index 0f8cb50..2d39b52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-27  Stefan Kost  <ensonic@users.sf.net>
+
+       * tests/examples/seek/seek.c:
+         Include config.h and check if we have X. Fixes: #540334.
+
 2008-06-26  Sebastian Dröge  <sebastian.droege@collabora.co.uk>
 
        Patch by: Sam Morris <sam at robots dot org to uk>
index 757455a..a03b5fc 100644 (file)
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <gst/gst.h>
 #include <string.h>
 
-#include <X11/Xlib.h>
+#ifdef HAVE_X
 #include <gdk/gdkx.h>
+#endif
 #include <gst/interfaces/xoverlay.h>
 
 GST_DEBUG_CATEGORY_STATIC (seek_debug);
@@ -2090,6 +2096,7 @@ msg_buffering (GstBus * bus, GstMessage * message, GstPipeline * data)
   }
 }
 
+#ifdef HAVE_X
 static GstBusSyncReply
 bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data)
 {
@@ -2112,6 +2119,7 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data)
   }
   return GST_BUS_PASS;
 }
+#endif
 
 static void
 msg_eos (GstBus * bus, GstMessage * message, GstPipeline * data)
@@ -2134,9 +2142,11 @@ connect_bus_signals (GstElement * pipeline)
 {
   GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
 
+#ifdef HAVE_X
   /* handle prepare-xwindow-id element message synchronously */
   gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler,
       pipeline);
+#endif
 
   gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
 
@@ -2244,11 +2254,6 @@ main (int argc, char **argv)
   if (!g_thread_supported ())
     g_thread_init (NULL);
 
-  if (!XInitThreads ()) {
-    g_print ("XInitThreads failed\n");
-    exit (-1);
-  }
-
   ctx = g_option_context_new ("- test seeking in gsteamer");
   g_option_context_add_main_entries (ctx, options, NULL);
   g_option_context_add_group (ctx, gst_init_get_option_group ());