Minor cleanup in the mint driver that was sitting on my laptop (sorry!).
authorRyan C. Gordon <icculus@icculus.org>
Sun, 01 Oct 2006 01:12:08 +0000
changeset 20448d5d119b1640
parent 2043 adf732f1f016
child 2045 510892a215a2
Minor cleanup in the mint driver that was sitting on my laptop (sorry!).
src/audio/mint/SDL_mintaudio_gsxb.c
     1.1 --- a/src/audio/mint/SDL_mintaudio_gsxb.c	Sun Sep 24 15:56:55 2006 +0000
     1.2 +++ b/src/audio/mint/SDL_mintaudio_gsxb.c	Sun Oct 01 01:12:08 2006 +0000
     1.3 @@ -227,45 +227,44 @@
     1.4      }
     1.5  
     1.6      while ((!valid_datatype) && (test_format)) {
     1.7 +        /* Check formats available */
     1.8 +        snd_format = Sndstatus(SND_QUERYFORMATS);
     1.9          spec->format = test_format;
    1.10 +        resolution = SDL_AUDIO_BITSIZE(spec->format);
    1.11 +        format_signed = SDL_AUDIO_ISSIGNED(spec->format);
    1.12 +        format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
    1.13          switch (test_format) {
    1.14 -        case AUDIO_U8:
    1.15 -        case AUDIO_S8:
    1.16 -        case AUDIO_U16LSB:
    1.17 -        case AUDIO_S16LSB:
    1.18 -        case AUDIO_U16MSB:
    1.19 -        case AUDIO_S16MSB:
    1.20 -        case AUDIO_S32LSB:
    1.21 -        case AUDIO_S32MSB:
    1.22 -            /* no float support... */
    1.23 -            resolution = SDL_AUDIO_BITSIZE(spec->format);
    1.24 -            format_signed = SDL_AUDIO_ISSIGNED(spec->format);
    1.25 -            format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
    1.26 -
    1.27 -            /* Check formats available */
    1.28 -            snd_format = Sndstatus(SND_QUERYFORMATS);
    1.29 -            switch (resolution) {
    1.30 -            case 8:
    1.31 +            case AUDIO_U8:
    1.32 +            case AUDIO_S8:
    1.33                  if (snd_format & SND_FORMAT8) {
    1.34                      valid_datatype = 1;
    1.35                      snd_format = Sndstatus(SND_QUERY8BIT);
    1.36                  }
    1.37                  break;
    1.38 -            case 16:
    1.39 +
    1.40 +            case AUDIO_U16LSB:
    1.41 +            case AUDIO_S16LSB:
    1.42 +            case AUDIO_U16MSB:
    1.43 +            case AUDIO_S16MSB:
    1.44                  if (snd_format & SND_FORMAT16) {
    1.45                      valid_datatype = 1;
    1.46                      snd_format = Sndstatus(SND_QUERY16BIT);
    1.47                  }
    1.48                  break;
    1.49 -            case 32:
    1.50 +
    1.51 +            case AUDIO_S32LSB:
    1.52 +            case AUDIO_S32MSB:
    1.53                  if (snd_format & SND_FORMAT32) {
    1.54                      valid_datatype = 1;
    1.55                      snd_format = Sndstatus(SND_QUERY32BIT);
    1.56                  }
    1.57                  break;
    1.58 -            }
    1.59  
    1.60 -            break;
    1.61 +            /* no float support... */
    1.62 +
    1.63 +            default:
    1.64 +                test_format = SDL_NextAudioFormat();
    1.65 +                break;
    1.66          }
    1.67      }
    1.68