x_libraries="/usr/X11R6/lib"
fi
+dnl Check for hal
+PKG_CHECK_MODULES(HAL, hal >= 0.2.97,
+ [AC_DEFINE(HAVE_HAL, [], [Define if you have the HAL library])
+ VLC_ADD_LDFLAGS([vlc],[$HAL_LIBS])
+ VLC_ADD_CFLAGS([vlc],[$HAL_CFLAGS])],
+ [AC_MSG_WARN(HAL library not found)])
+
dnl Build the gtk_main plugins?
NEED_GTK_MAIN=no
NEED_GNOME_MAIN=no
# include <locale.h>
#endif
+#ifdef HAVE_HAL
+# include <hal/libhal.h>
+#endif
+
#include "vlc_cpu.h" /* CPU detection */
#include "os_specific.h"
static int VerboseCallback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
+static void InitDeviceValues( vlc_t * );
+
/*****************************************************************************
* vlc_current_object: return the current object.
*****************************************************************************
return VLC_EEXIT;
}
+ /*
+ * Init device values
+ */
+ InitDeviceValues( p_vlc );
+
/*
* Override default configuration with config file settings
*/
}
return VLC_SUCCESS;
}
+
+/*****************************************************************************
+ * InitDeviceValues: initialize device values
+ *****************************************************************************
+ * This function inits the dvd, vcd and cd-audio values
+ *****************************************************************************/
+static void InitDeviceValues( vlc_t *p_vlc )
+{
+#ifdef HAVE_HAL
+ LibHalContext * ctx;
+ int i, i_devices;
+ char **devices;
+ char *block_dev;
+ dbus_bool_t b_dvd;
+
+ if( ( ctx = hal_initialize( NULL, FALSE ) ) )
+ {
+ if( ( devices = hal_get_all_devices( ctx, &i_devices ) ) )
+ {
+ for( i = 0; i < i_devices; i++ )
+ {
+ if( !hal_device_property_exists( ctx, devices[ i ],
+ "storage.cdrom.dvd" ) )
+ {
+ continue;
+ }
+
+ b_dvd = hal_device_get_property_bool( ctx, devices[ i ],
+ "storage.cdrom.dvd" );
+ block_dev = hal_device_get_property_string( ctx, devices[ i ],
+ "block.device" );
+
+ if( b_dvd )
+ {
+ config_PutPsz( p_vlc, "dvd", block_dev );
+ }
+
+ config_PutPsz( p_vlc, "vcd", block_dev );
+ config_PutPsz( p_vlc, "cd-audio", block_dev );
+
+ hal_free_string( block_dev );
+ }
+ }
+
+ hal_shutdown( ctx );
+ }
+#endif
+}