Don't use D-Bus with hal < 0.5.0
authorRafaël Carré <funman@videolan.org>
Mon, 13 Nov 2006 21:14:34 +0000 (21:14 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 13 Nov 2006 21:14:34 +0000 (21:14 +0000)
modules/services_discovery/hal.c

index 52da298..30cb704 100644 (file)
@@ -81,15 +81,17 @@ static int Open( vlc_object_t *p_this )
 
     playlist_t          *p_playlist;
 
+#ifdef HAVE_HAL_1
     DBusError           dbus_error;
     DBusConnection      *p_connection;
+#endif
 
     p_sd->pf_run = Run;
     p_sd->p_sys  = p_sys;
 
+#ifdef HAVE_HAL_1
     dbus_error_init( &dbus_error );
 
-#ifdef HAVE_HAL_1
     p_sys->p_ctx = libhal_ctx_new();
     if( !p_sys->p_ctx )
     {
@@ -111,8 +113,12 @@ static int Open( vlc_object_t *p_this )
     if( !(p_sys->p_ctx = hal_initialize( NULL, FALSE ) ) )
 #endif
     {
+#ifdef HAVE_HAL_1
         msg_Err( p_sd, "hal not available : %s", dbus_error.message );
         dbus_error_free( &dbus_error );
+#else
+        msg_Err( p_sd, "hal not available" );
+#endif
         free( p_sys );
         return VLC_EGENERIC;
     }