Commit 5c6b3c5f authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

iOS: remove msiounit filter's audio interruption listener

parent a2fceb8d
...@@ -152,35 +152,10 @@ static const char *FormatError(OSStatus error) ...@@ -152,35 +152,10 @@ static const char *FormatError(OSStatus error)
#define check_auresult(au,method) \ #define check_auresult(au,method) \
if (au!=0) ms_error("AudioUnit error for %s: ret=%s (%li) ",method, FormatError(au), au) if (au!=0) ms_error("AudioUnit error for %s: ret=%s (%li) ",method, FormatError(au), au)
static void au_interuption_listener(void* inClientData, UInt32 inInterruptionState) {
if (!filter_valid) return;
if (((MSSndCard*)inClientData)->data == NULL) return;
AUData *d=(AUData*)(((MSSndCard*)inClientData)->data);
if (d->started == FALSE) {
//nothing to do
switch (inInterruptionState) {
case kAudioSessionBeginInterruption:
ms_message ("IO unit interruption begin");
case kAudioSessionEndInterruption:
// make sure we are again the active session
ms_message ("IO unit interruption end");
OSStatus auresult = AudioSessionSetActive(true);
ms_warning ("unexpected interuption %li",inInterruptionState);
static MSSndCard *au_card_new(const char* name){ static MSSndCard *au_card_new(const char* name){
MSSndCard *card=ms_snd_card_new_with_name(&au_card_desc,name); MSSndCard *card=ms_snd_card_new_with_name(&au_card_desc,name);
OSStatus auresult = AudioSessionInitialize(NULL, NULL, au_interuption_listener, card); OSStatus auresult = AudioSessionInitialize(NULL, NULL, NULL, card);
if (auresult != kAudioSessionAlreadyInitialized) { if (auresult != kAudioSessionAlreadyInitialized) {
check_auresult(auresult,"AudioSessionInitialize"); check_auresult(auresult,"AudioSessionInitialize");
} }
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