sndio dynamic loading fix.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 07 Jul 2013 20:06:08 -0400
changeset 7377489d5c90e9da
parent 7376 a2ea9757bfa0
child 7378 3d5f62bac8e7
sndio dynamic loading fix.
src/audio/sndio/SDL_sndioaudio.c
     1.1 --- a/src/audio/sndio/SDL_sndioaudio.c	Sun Jul 07 14:08:07 2013 -0700
     1.2 +++ b/src/audio/sndio/SDL_sndioaudio.c	Sun Jul 07 20:06:08 2013 -0400
     1.3 @@ -146,13 +146,15 @@
     1.4  static void
     1.5  SNDIO_WaitDevice(_THIS)
     1.6  {
     1.7 -    /* no-op; sio_write() blocks if necessary. */
     1.8 +    /* no-op; SNDIO_sio_write() blocks if necessary. */
     1.9  }
    1.10  
    1.11  static void
    1.12  SNDIO_PlayDevice(_THIS)
    1.13  {
    1.14 -    const int written = sio_write(this->hidden->dev, this->hidden->mixbuf, this->hidden->mixlen);
    1.15 +    const int written = SNDIO_sio_write(this->hidden->dev,
    1.16 +                                        this->hidden->mixbuf,
    1.17 +                                        this->hidden->mixlen);
    1.18  
    1.19      /* If we couldn't write, assume fatal error for now */
    1.20      if ( written == 0 ) {
    1.21 @@ -172,7 +174,7 @@
    1.22  static void
    1.23  SNDIO_WaitDone(_THIS)
    1.24  {
    1.25 -    sio_stop(this->hidden->dev);
    1.26 +    SNDIO_sio_stop(this->hidden->dev);
    1.27  }
    1.28  
    1.29  static void
    1.30 @@ -184,7 +186,7 @@
    1.31              this->hidden->mixbuf = NULL;
    1.32          }
    1.33          if ( this->hidden->dev != NULL ) {
    1.34 -            sio_close(this->hidden->dev);
    1.35 +            SNDIO_sio_close(this->hidden->dev);
    1.36              this->hidden->dev = NULL;
    1.37          }
    1.38          SDL_free(this->hidden);
    1.39 @@ -209,12 +211,12 @@
    1.40      this->hidden->mixlen = this->spec.size;
    1.41  
    1.42      /* !!! FIXME: SIO_DEVANY can be a specific device... */
    1.43 -    if ((this->hidden->dev = sio_open(0 /*SIO_DEVANY*/, SIO_PLAY, 0)) == NULL) {
    1.44 +    if ((this->hidden->dev = SNDIO_sio_open(NULL, SIO_PLAY, 0)) == NULL) {
    1.45          SNDIO_CloseDevice(this);
    1.46          return SDL_SetError("sio_open() failed");
    1.47      }
    1.48  
    1.49 -    sio_initpar(&par);
    1.50 +    SNDIO_sio_initpar(&par);
    1.51  
    1.52      par.rate = this->spec.freq;
    1.53      par.pchan = this->spec.channels;
    1.54 @@ -229,7 +231,7 @@
    1.55              par.sig = SDL_AUDIO_ISSIGNED(test_format) ? 1 : 0;
    1.56              par.bits = SDL_AUDIO_BITSIZE(test_format);
    1.57  
    1.58 -            if (sio_setpar(this->hidden->dev, &par) == 1) {
    1.59 +            if (SNDIO_sio_setpar(this->hidden->dev, &par) == 1) {
    1.60                  status = 0;
    1.61                  break;
    1.62              }
    1.63 @@ -242,7 +244,7 @@
    1.64          return SDL_SetError("sndio: Couldn't find any hardware audio formats");
    1.65      }
    1.66  
    1.67 -    if (sio_getpar(this->hidden->dev, &par) == 0) {
    1.68 +    if (SNDIO_sio_getpar(this->hidden->dev, &par) == 0) {
    1.69          SNDIO_CloseDevice(this);
    1.70          return SDL_SetError("sio_getpar() failed");
    1.71      }
    1.72 @@ -284,7 +286,7 @@
    1.73      }
    1.74      SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
    1.75  
    1.76 -    if (!sio_start(this->hidden->dev)) {
    1.77 +    if (!SNDIO_sio_start(this->hidden->dev)) {
    1.78          return SDL_SetError("sio_start() failed");
    1.79      }
    1.80