]> git.sesse.net Git - vlc/commitdiff
* Fix the screensaver module for newer dbus APIs. Reported by Stone <syphyr at gmail...
authorBenjamin Pracht <bigben@videolan.org>
Sat, 16 Sep 2006 14:36:51 +0000 (14:36 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Sat, 16 Sep 2006 14:36:51 +0000 (14:36 +0000)
configure.ac
modules/misc/screensaver.c

index 84ec22f1de38efb4e5bfefdc82d90e11f97aa555..8d38a7b403b008333ab348059a22275c07048073 100644 (file)
@@ -838,18 +838,26 @@ AC_ARG_ENABLE(dbus,
  
 if test "${enable_dbus}" != "no"
 then
-  PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.30,
-    [ AC_DEFINE( HAVE_DBUS_1, 1, [Define if you have the new D-BUS library API])
+  PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.92,
+    [ AC_DEFINE( HAVE_DBUS_2, 1, [Define if you have the D-BUS library API >= 0.92] )
+      AC_DEFINE( HAVE_DBUS_1, 1, [Define if you have the D-BUS library API >= 0.30] )
       AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
       VLC_ADD_LDFLAGS([screensaver],[$DBUS_LIBS])
-      VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],   
+      VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
     dnl older dbus
-    [ PKG_CHECK_MODULES( DBUS, dbus-1, 
-       [AC_DEFINE(HAVE_DBUS, 1, [Define if you have the D-BUS library])
+    PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.30,
+      [ AC_DEFINE( HAVE_DBUS_1, 1, [Define if you have the D-BUS library API >= 0.30 ] )
+        AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
         VLC_ADD_LDFLAGS([screensaver],[$DBUS_LIBS])
-        VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
-       [AC_MSG_WARN(DBUS library not found)])
-    ]
+        VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],   
+      dnl much older dbus
+      [ PKG_CHECK_MODULES( DBUS, dbus-1, 
+         [AC_DEFINE(HAVE_DBUS, 1, [Define if you have the D-BUS library])
+          VLC_ADD_LDFLAGS([screensaver],[$DBUS_LIBS])
+          VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
+         [AC_MSG_WARN(DBUS library not found)])
+      ]
+    )
   )
 fi
 
index e3218d7d1a6c04f560dd846285984ed6e4c87876..36d87d51a99426c9a9e834bce1b56d66563c2359 100644 (file)
@@ -110,7 +110,11 @@ static void Deactivate( vlc_object_t *p_this )
 
     if( p_intf->p_sys->p_connection )
     {
+#  ifdef HAVE_DBUS_2
+        dbus_connection_close( p_intf->p_sys->p_connection );
+#  else
         dbus_connection_disconnect( p_intf->p_sys->p_connection );
+#  endif
     }
 
     if( p_intf->p_sys )