coreaudio: Apple doesn't support U16 data, so convert in that case.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 25 Sep 2019 15:07:07 -0400
changeset 13092307068253f19
parent 13091 06109263e82a
child 13093 599ed6e984d2
coreaudio: Apple doesn't support U16 data, so convert in that case.
src/audio/coreaudio/SDL_coreaudio.m
     1.1 --- a/src/audio/coreaudio/SDL_coreaudio.m	Tue Sep 24 17:49:53 2019 -0400
     1.2 +++ b/src/audio/coreaudio/SDL_coreaudio.m	Wed Sep 25 15:07:07 2019 -0400
     1.3 @@ -819,13 +819,11 @@
     1.4  
     1.5      while ((!valid_datatype) && (test_format)) {
     1.6          this->spec.format = test_format;
     1.7 -        /* Just a list of valid SDL formats, so people don't pass junk here. */
     1.8 +        /* CoreAudio handles most of SDL's formats natively, but not U16, apparently. */
     1.9          switch (test_format) {
    1.10          case AUDIO_U8:
    1.11          case AUDIO_S8:
    1.12 -        case AUDIO_U16LSB:
    1.13          case AUDIO_S16LSB:
    1.14 -        case AUDIO_U16MSB:
    1.15          case AUDIO_S16MSB:
    1.16          case AUDIO_S32LSB:
    1.17          case AUDIO_S32MSB:
    1.18 @@ -841,6 +839,10 @@
    1.19              else if (SDL_AUDIO_ISSIGNED(this->spec.format))
    1.20                  strdesc->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
    1.21              break;
    1.22 +
    1.23 +        default:
    1.24 +            test_format = SDL_NextAudioFormat();
    1.25 +            break;
    1.26          }
    1.27      }
    1.28