Commit 9667c570 authored by Simon Morlat's avatar Simon Morlat
Browse files

Recreate audio unit in case of audio sample rate change. Indeed, this happens...

Recreate audio unit in case of audio sample rate change. Indeed, this happens in case of audio device change, such as connecting or disconnecting from a bluetooth device.
It appears that, in some case the AudioUnit is unable to recover to the disconnection, and thus should be destroyed and re-created.
parent 7cc6d015
......@@ -698,7 +698,7 @@ static void handle_sample_rate_change(void){
[au_holder setRate:rate];
if ([au_holder audio_unit_state] == MSAudioUnitConfigured || [au_holder audio_unit_state] == MSAudioUnitStarted){
[au_holder stop_audio_unit];
[au_holder recreate_audio_unit];
[au_holder configure_audio_unit];
[au_holder start_audio_unit:0];
}
......
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