src/audio/SDL_audiocvt.c
changeset 10777 2883d23b5a28
parent 10776 7e935b2c430f
child 10789 e3eb7a266ec2
     1.1 --- a/src/audio/SDL_audiocvt.c	Fri Jan 06 21:23:51 2017 -0500
     1.2 +++ b/src/audio/SDL_audiocvt.c	Fri Jan 06 20:43:53 2017 -0800
     1.3 @@ -29,7 +29,7 @@
     1.4  #include "SDL_assert.h"
     1.5  #include "../SDL_dataqueue.h"
     1.6  
     1.7 -#ifdef HAVE_LIBSAMPLERATE
     1.8 +#if HAVE_LIBSAMPLERATE_H
     1.9  #include "samplerate.h"
    1.10  #endif
    1.11  
    1.12 @@ -633,7 +633,7 @@
    1.13      SDL_CleanupAudioStreamResamplerFunc cleanup_resampler_func;
    1.14  };
    1.15  
    1.16 -#ifdef HAVE_LIBSAMPLERATE
    1.17 +#ifdef HAVE_LIBSAMPLERATE_H
    1.18  
    1.19  typedef struct
    1.20  {
    1.21 @@ -651,8 +651,8 @@
    1.22  static SDL_bool
    1.23  LoadLibSampleRate(SDL_AudioStreamResamplerState_SRC *state)
    1.24  {
    1.25 -#ifdef LIBSAMPLERATE_DYNAMIC
    1.26 -    state->SRC_lib = SDL_LoadObject(LIBSAMPLERATE_DYNAMIC);
    1.27 +#ifdef SDL_LIBSAMPLERATE_DYNAMIC
    1.28 +    state->SRC_lib = SDL_LoadObject(SDL_LIBSAMPLERATE_DYNAMIC);
    1.29      if (!state->SRC_lib) {
    1.30          return SDL_FALSE;
    1.31      }
    1.32 @@ -676,7 +676,7 @@
    1.33      SRC_DATA data;
    1.34      int result;
    1.35  
    1.36 -    data.data_in = inbuf;
    1.37 +    data.data_in = (float *)inbuf; /* Older versions of libsamplerate had a non-const pointer, but didn't write to it */
    1.38      data.input_frames = inbuflen / ( sizeof(float) * stream->pre_resample_channels );
    1.39      data.input_frames_used = 0;
    1.40  
    1.41 @@ -752,7 +752,7 @@
    1.42      return SDL_TRUE;
    1.43  }
    1.44  
    1.45 -#endif /* HAVE_LIBSAMPLERATE */
    1.46 +#endif /* HAVE_LIBSAMPLERATE_H */
    1.47  
    1.48  typedef struct
    1.49  {
    1.50 @@ -873,7 +873,7 @@
    1.51              return NULL;  /* SDL_BuildAudioCVT should have called SDL_SetError. */
    1.52          }
    1.53  
    1.54 -#ifdef HAVE_LIBSAMPLERATE
    1.55 +#ifdef HAVE_LIBSAMPLERATE_H
    1.56          SetupLibSampleRateResampling(retval);
    1.57  #endif
    1.58