From 693755f0b2268541a5aefd131626f533f7d923b0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 25 Sep 2019 15:07:07 -0400 Subject: [PATCH] coreaudio: Apple doesn't support U16 data, so convert in that case. --- src/audio/coreaudio/SDL_coreaudio.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index 813b493b0..212cd4119 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -819,13 +819,11 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) while ((!valid_datatype) && (test_format)) { this->spec.format = test_format; - /* Just a list of valid SDL formats, so people don't pass junk here. */ + /* CoreAudio handles most of SDL's formats natively, but not U16, apparently. */ switch (test_format) { case AUDIO_U8: case AUDIO_S8: - case AUDIO_U16LSB: case AUDIO_S16LSB: - case AUDIO_U16MSB: case AUDIO_S16MSB: case AUDIO_S32LSB: case AUDIO_S32MSB: @@ -841,6 +839,10 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture) else if (SDL_AUDIO_ISSIGNED(this->spec.format)) strdesc->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; break; + + default: + test_format = SDL_NextAudioFormat(); + break; } }