diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index 10962c5db..68aae3578 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -855,6 +855,7 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) AVAudioSession* session = [AVAudioSession sharedInstance]; [session setPreferredSampleRate:this->spec.freq error:nil]; this->spec.freq = (int)session.sampleRate; +#if TARGET_OS_TV if (iscapture) { [session setPreferredInputNumberOfChannels:this->spec.channels error:nil]; this->spec.channels = session.preferredInputNumberOfChannels; @@ -862,6 +863,9 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) [session setPreferredOutputNumberOfChannels:this->spec.channels error:nil]; this->spec.channels = session.preferredOutputNumberOfChannels; } +#else + /* Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS */ +#endif /* TARGET_OS_TV */ } #endif