[snappy/release_0.2: 2/2] snappy: check if dbus enabled in preprocessor
- From: Luis de Bethencourt <luisbg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snappy/release_0.2: 2/2] snappy: check if dbus enabled in preprocessor
- Date: Fri, 27 Apr 2012 12:56:03 +0000 (UTC)
commit b201471b938a11f6c4c9a37ee6225e69ecd2d295
Author: Luis de Bethencourt <luis debethencourt collabora com>
Date: Wed Jun 29 17:24:12 2011 +0200
snappy: check if dbus enabled in preprocessor
dlna code not compiled if dbus isn't available
src/dlna.c | 8 ++++++++
src/snappy.c | 17 ++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/src/dlna.c b/src/dlna.c
index 000601d..1a05aed 100644
--- a/src/dlna.c
+++ b/src/dlna.c
@@ -20,6 +20,12 @@
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef ENABLE_DBUS
+
#include <gio/gio.h>
#include <stdlib.h>
@@ -573,3 +579,5 @@ close_dlna (SnappyMP * mp)
return TRUE;
}
+
+#endif
diff --git a/src/snappy.c b/src/snappy.c
index b73a8a3..a84e2ee 100644
--- a/src/snappy.c
+++ b/src/snappy.c
@@ -22,6 +22,10 @@
#define VERSION "0.2"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@@ -29,7 +33,11 @@
#include <clutter-gst/clutter-gst.h>
#include "user_interface.h"
+
+#ifdef ENABLE_DBUS
#include "dlna.h"
+#endif
+
#include "gst_engine.h"
#include "utils.h"
@@ -135,7 +143,6 @@ main (int argc, char *argv[])
{
UserInterface *ui = NULL;
GstEngine *engine = NULL;
- SnappyMP *mp_obj = NULL;
ClutterActor *video_texture;
GstElement *sink;
@@ -146,6 +153,10 @@ main (int argc, char *argv[])
gchar *file_list[argc];
GOptionContext *context;
+#ifdef ENABLE_DBUS
+ SnappyMP *mp_obj = NULL;
+#endif
+
if (!g_thread_supported ())
g_thread_init (NULL);
@@ -196,18 +207,22 @@ main (int argc, char *argv[])
change_state (engine, "Paused");
change_state (engine, "Playing");
+#ifdef ENABLE_DBUS
/* Start MPRIS Dbus object */
mp_obj = g_new (SnappyMP, 1);
mp_obj->engine = engine;
mp_obj->ui = ui;
load_dlna (mp_obj);
+#endif
/* Main loop */
clutter_main ();
/* Close snappy */
close_down (ui, engine);
+#ifdef ENABLE_DBUS
close_dlna (mp_obj);
+#endif
quit:
g_option_context_free (context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]