diff src/audio/macrom/SDL_romaudio.c @ 2054:d22372343744

Patched to compile.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 28 Oct 2006 07:39:35 +0000
parents 5f6550e5184f
children 866052b01ee5
line wrap: on
line diff
--- a/src/audio/macrom/SDL_romaudio.c	Fri Oct 27 20:19:48 2006 +0000
+++ b/src/audio/macrom/SDL_romaudio.c	Sat Oct 28 07:39:35 2006 +0000
@@ -158,6 +158,26 @@
     }
 }
 
+static void
+SNDMGR_CloseDevice(_THIS)
+{
+    running = 0;
+
+    if (this->hidden != NULL) {
+        if (this->hidden->channel) {
+            SndDisposeChannel(this->hidden->channel, true);
+            this->hidden->channel = NULL;
+        }
+
+        SDL_free(buffer[0]);
+        SDL_free(buffer[1]);
+        buffer[0] = buffer[1] = NULL;
+
+        SDL_free(this->hidden);
+        this->hidden = NULL;
+    }
+}
+
 static int
 SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture)
 {
@@ -271,28 +291,6 @@
     return 1;
 }
 
-static void
-SNDMGR_CloseDevice(_THIS)
-{
-    int i;
-
-    running = 0;
-
-    if (this->hidden->channel) {
-        SndDisposeChannel(this->hidden->channel, true);
-        this->hidden->channel = NULL;
-    }
-
-    for (i = 0; i < 2; ++i) {
-        if (buffer[i]) {
-            SDL_free(buffer[i]);
-            buffer[i] = NULL;
-        }
-    }
-    SDL_free(this->hidden);
-    this->hidden = NULL;
-}
-
 static int
 SNDMGR_Init(SDL_AudioDriverImpl *impl)
 {