Skip to content

Commit

Permalink
coreaudio: Apple doesn't support U16 data, so convert in that case.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 25, 2019
1 parent ee6d504 commit 693755f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/audio/coreaudio/SDL_coreaudio.m
Expand Up @@ -819,13 +819,11 @@ static BOOL update_audio_session(_THIS, SDL_bool open)

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:
Expand All @@ -841,6 +839,10 @@ static BOOL update_audio_session(_THIS, SDL_bool open)
else if (SDL_AUDIO_ISSIGNED(this->spec.format))
strdesc->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
break;

default:
test_format = SDL_NextAudioFormat();
break;
}
}

Expand Down

0 comments on commit 693755f

Please sign in to comment.