Commit 0f62e1ad authored by David Fuhrmann's avatar David Fuhrmann Committed by 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: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent a6fcfb77
......@@ -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 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment