Changeset 5f15a425fcaacd155a301ab8324cedad2a3ea651
- Timestamp:
- 27/11/05 12:30:14
(3 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1133091014 +0000
- git-parent:
[7af8b2413813eb84e0643109f68b5fbe36b43ca1]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1133091014 +0000
- Message:
Fix new HAL interaction
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcaaf675 |
r5f15a42 |
|
| 105 | 105 | |
|---|
| 106 | 106 | DBusError dbus_error; |
|---|
| | 107 | DBusConnection *p_connection; |
|---|
| 107 | 108 | |
|---|
| 108 | 109 | p_sd->pf_run = Run; |
|---|
| … | … | |
| 112 | 113 | |
|---|
| 113 | 114 | #ifdef HAVE_HAL_1 |
|---|
| 114 | | if( !( p_sys->p_ctx = libhal_ctx_init_direct( &dbus_error ) ) ) |
|---|
| 115 | | #else |
|---|
| 116 | | if( !( p_sys->p_ctx = hal_initialize( NULL, FALSE ) ) ) |
|---|
| 117 | | #endif |
|---|
| 118 | | { |
|---|
| | 115 | p_sys->p_ctx = libhal_ctx_new(); |
|---|
| | 116 | if( !p_sys->p_ctx ) |
|---|
| | 117 | { |
|---|
| | 118 | msg_Err( p_sd, "Unable to create HAL context") ; |
|---|
| 119 | 119 | free( p_sys ); |
|---|
| | 120 | return VLC_EGENERIC; |
|---|
| | 121 | } |
|---|
| | 122 | p_connection = dbus_bus_get( DBUS_BUS_SYSTEM, &dbus_error ); |
|---|
| | 123 | if( dbus_error_is_set( &dbus_error ) ) |
|---|
| | 124 | { |
|---|
| | 125 | msg_Err( p_sd, "Unable to connect to DBUS: %s", dbus_error.message ); |
|---|
| | 126 | dbus_error_free( &dbus_error ); |
|---|
| | 127 | free( p_sys ); |
|---|
| | 128 | return VLC_EGENERIC; |
|---|
| | 129 | } |
|---|
| | 130 | libhal_ctx_set_dbus_connection( p_sys->p_ctx, p_connection ); |
|---|
| | 131 | if( !libhal_ctx_init( p_sys->p_ctx, &dbus_error ) ) |
|---|
| | 132 | #else |
|---|
| | 133 | if( !(p_sys->p_ctx = hal_initialize( NULL, FALSE ) ) ) |
|---|
| | 134 | #endif |
|---|
| | 135 | { |
|---|
| 120 | 136 | msg_Err( p_sd, "hal not available : %s", dbus_error.message ); |
|---|
| | 137 | dbus_error_free( &dbus_error ); |
|---|
| | 138 | free( p_sys ); |
|---|
| 121 | 139 | return VLC_EGENERIC; |
|---|
| 122 | 140 | } |
|---|
| r7b885b9 |
r5f15a42 |
|
| 2557 | 2557 | char *block_dev; |
|---|
| 2558 | 2558 | dbus_bool_t b_dvd; |
|---|
| | 2559 | DBusConnection *p_connection; |
|---|
| | 2560 | DBusError error; |
|---|
| 2559 | 2561 | |
|---|
| 2560 | 2562 | #ifdef HAVE_HAL_1 |
|---|
| 2561 | | if( ( ctx = libhal_ctx_init_direct( NULL ) ) ) |
|---|
| | 2563 | ctx = libhal_ctx_new(); |
|---|
| | 2564 | if( !ctx ) return; |
|---|
| | 2565 | dbus_error_init( &error ); |
|---|
| | 2566 | p_connection = dbus_bus_get ( DBUS_BUS_SYSTEM, &error ); |
|---|
| | 2567 | if( dbus_error_is_set( &error ) ) |
|---|
| | 2568 | { |
|---|
| | 2569 | dbus_error_free( &error ); |
|---|
| | 2570 | return; |
|---|
| | 2571 | } |
|---|
| | 2572 | libhal_ctx_set_dbus_connection( ctx, p_connection ); |
|---|
| | 2573 | if( !libhal_ctx_init( ctx, &error ) ) |
|---|
| 2562 | 2574 | #else |
|---|
| 2563 | 2575 | if( ( ctx = hal_initialize( NULL, FALSE ) ) ) |
|---|
| … | … | |
| 2619 | 2631 | #endif |
|---|
| 2620 | 2632 | } |
|---|
| | 2633 | else |
|---|
| | 2634 | { |
|---|
| | 2635 | msg_Dbg( p_vlc, "Unable to get HAL device properties" ); |
|---|
| | 2636 | } |
|---|
| 2621 | 2637 | #endif |
|---|
| 2622 | 2638 | } |
|---|