[vlc-commits] auhal: always set audio device callback

David Fuhrmann git at videolan.org
Fri Jan 13 11:45:18 CET 2012


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Jan 12 17:41:36 2012 +0100| [0f62e1ad4efcaf72f2d99784c8a19a9b0dbea968] | committer: Felix Paul Kühne

auhal: always set audio device callback

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.

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0f62e1ad4efcaf72f2d99784c8a19a9b0dbea968
---

 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..0e2c4b2 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 )



More information about the vlc-commits mailing list