[vlc-devel] [PATCH] auhal: always set audio device callback

David Fuhrmann david.fuhrmann at googlemail.com
Thu Jan 12 17:41:36 CET 2012


Previously, the audio device callback was only set when you call probe.
But in the case you reload the module (for example when switching from
encoded to unencoded output over the UI menu) probe was not called again.
This resulted in a crash when we want to delete the callback while closing.
---
 modules/audio_output/auhal.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index ab318c6..1d2fdba 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -249,6 +249,9 @@ static int Open( vlc_object_t * p_this )
         goto error;
     }
 
+    /* If we change the device we want to use, we should renegotiate the audio chain */
+    var_AddCallback( p_aout, "audio-device", AudioDeviceCallback, NULL );
+    
     /* Check for Digital mode or Analog output mode */
     if( AOUT_FMT_SPDIF( &p_aout->format ) && b_supports_digital )
     {
@@ -1033,9 +1036,6 @@ static void Probe( audio_output_t * p_aout )
         var_Set( p_aout, "audio-device", val );
     }
 
-    /* If we change the device we want to use, we should renegotiate the audio chain */
-    var_AddCallback( p_aout, "audio-device", AudioDeviceCallback, NULL );
-
     /* Attach a Listener so that we are notified of a change in the Device setup */
     err = AudioObjectAddPropertyListener( kAudioObjectSystemObject, &audioDevicesAddress, HardwareListener, (void *)p_aout );
     if( err )
-- 
1.7.5.4




More information about the vlc-devel mailing list