src/audio/mint/SDL_mintaudio_gsxb.c
changeset 2044 8d5d119b1640
parent 2043 adf732f1f016
child 2049 5f6550e5184f
child 3796 b19680c84cdf
--- a/src/audio/mint/SDL_mintaudio_gsxb.c	Sun Sep 24 15:56:55 2006 +0000
+++ b/src/audio/mint/SDL_mintaudio_gsxb.c	Sun Oct 01 01:12:08 2006 +0000
@@ -227,45 +227,44 @@
     }
 
     while ((!valid_datatype) && (test_format)) {
+        /* Check formats available */
+        snd_format = Sndstatus(SND_QUERYFORMATS);
         spec->format = test_format;
+        resolution = SDL_AUDIO_BITSIZE(spec->format);
+        format_signed = SDL_AUDIO_ISSIGNED(spec->format);
+        format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
         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:
-            /* no float support... */
-            resolution = SDL_AUDIO_BITSIZE(spec->format);
-            format_signed = SDL_AUDIO_ISSIGNED(spec->format);
-            format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
-
-            /* Check formats available */
-            snd_format = Sndstatus(SND_QUERYFORMATS);
-            switch (resolution) {
-            case 8:
+            case AUDIO_U8:
+            case AUDIO_S8:
                 if (snd_format & SND_FORMAT8) {
                     valid_datatype = 1;
                     snd_format = Sndstatus(SND_QUERY8BIT);
                 }
                 break;
-            case 16:
+
+            case AUDIO_U16LSB:
+            case AUDIO_S16LSB:
+            case AUDIO_U16MSB:
+            case AUDIO_S16MSB:
                 if (snd_format & SND_FORMAT16) {
                     valid_datatype = 1;
                     snd_format = Sndstatus(SND_QUERY16BIT);
                 }
                 break;
-            case 32:
+
+            case AUDIO_S32LSB:
+            case AUDIO_S32MSB:
                 if (snd_format & SND_FORMAT32) {
                     valid_datatype = 1;
                     snd_format = Sndstatus(SND_QUERY32BIT);
                 }
                 break;
-            }
+
+            /* no float support... */
 
-            break;
+            default:
+                test_format = SDL_NextAudioFormat();
+                break;
         }
     }