sndio dynamic loading fix.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 07 Jul 2013 20:06:08 -0400
changeset 7377 489d5c90e9da
parent 7376 a2ea9757bfa0
child 7378 3d5f62bac8e7
sndio dynamic loading fix.
src/audio/sndio/SDL_sndioaudio.c
--- a/src/audio/sndio/SDL_sndioaudio.c	Sun Jul 07 14:08:07 2013 -0700
+++ b/src/audio/sndio/SDL_sndioaudio.c	Sun Jul 07 20:06:08 2013 -0400
@@ -146,13 +146,15 @@
 static void
 SNDIO_WaitDevice(_THIS)
 {
-    /* no-op; sio_write() blocks if necessary. */
+    /* no-op; SNDIO_sio_write() blocks if necessary. */
 }
 
 static void
 SNDIO_PlayDevice(_THIS)
 {
-    const int written = sio_write(this->hidden->dev, this->hidden->mixbuf, this->hidden->mixlen);
+    const int written = SNDIO_sio_write(this->hidden->dev,
+                                        this->hidden->mixbuf,
+                                        this->hidden->mixlen);
 
     /* If we couldn't write, assume fatal error for now */
     if ( written == 0 ) {
@@ -172,7 +174,7 @@
 static void
 SNDIO_WaitDone(_THIS)
 {
-    sio_stop(this->hidden->dev);
+    SNDIO_sio_stop(this->hidden->dev);
 }
 
 static void
@@ -184,7 +186,7 @@
             this->hidden->mixbuf = NULL;
         }
         if ( this->hidden->dev != NULL ) {
-            sio_close(this->hidden->dev);
+            SNDIO_sio_close(this->hidden->dev);
             this->hidden->dev = NULL;
         }
         SDL_free(this->hidden);
@@ -209,12 +211,12 @@
     this->hidden->mixlen = this->spec.size;
 
     /* !!! FIXME: SIO_DEVANY can be a specific device... */
-    if ((this->hidden->dev = sio_open(0 /*SIO_DEVANY*/, SIO_PLAY, 0)) == NULL) {
+    if ((this->hidden->dev = SNDIO_sio_open(NULL, SIO_PLAY, 0)) == NULL) {
         SNDIO_CloseDevice(this);
         return SDL_SetError("sio_open() failed");
     }
 
-    sio_initpar(&par);
+    SNDIO_sio_initpar(&par);
 
     par.rate = this->spec.freq;
     par.pchan = this->spec.channels;
@@ -229,7 +231,7 @@
             par.sig = SDL_AUDIO_ISSIGNED(test_format) ? 1 : 0;
             par.bits = SDL_AUDIO_BITSIZE(test_format);
 
-            if (sio_setpar(this->hidden->dev, &par) == 1) {
+            if (SNDIO_sio_setpar(this->hidden->dev, &par) == 1) {
                 status = 0;
                 break;
             }
@@ -242,7 +244,7 @@
         return SDL_SetError("sndio: Couldn't find any hardware audio formats");
     }
 
-    if (sio_getpar(this->hidden->dev, &par) == 0) {
+    if (SNDIO_sio_getpar(this->hidden->dev, &par) == 0) {
         SNDIO_CloseDevice(this);
         return SDL_SetError("sio_getpar() failed");
     }
@@ -284,7 +286,7 @@
     }
     SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
 
-    if (!sio_start(this->hidden->dev)) {
+    if (!SNDIO_sio_start(this->hidden->dev)) {
         return SDL_SetError("sio_start() failed");
     }