audio: Patched to compile if linking directly to libsamplerate.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 09 Jan 2017 05:59:30 -0500
changeset 107981af225fe35cc
parent 10797 c23bdf7436b3
child 10799 234f71894a52
audio: Patched to compile if linking directly to libsamplerate.
src/audio/SDL_audio.c
     1.1 --- a/src/audio/SDL_audio.c	Mon Jan 09 02:54:42 2017 -0800
     1.2 +++ b/src/audio/SDL_audio.c	Mon Jan 09 05:59:30 2017 -0500
     1.3 @@ -134,7 +134,6 @@
     1.4      if (!SRC_lib) {
     1.5          return SDL_FALSE;
     1.6      }
     1.7 -#endif
     1.8  
     1.9      SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new");
    1.10      SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process");
    1.11 @@ -143,12 +142,17 @@
    1.12      SRC_src_strerror = (const char* (*)(int error))SDL_LoadFunction(SRC_lib, "src_strerror");
    1.13  
    1.14      if (!SRC_src_new || !SRC_src_process || !SRC_src_reset || !SRC_src_delete || !SRC_src_strerror) {
    1.15 -        #ifdef SDL_LIBSAMPLERATE_DYNAMIC
    1.16          SDL_UnloadObject(SRC_lib);
    1.17          SRC_lib = NULL;
    1.18 -        #endif
    1.19          return SDL_FALSE;
    1.20      }
    1.21 +#else
    1.22 +    SRC_src_new = src_new;
    1.23 +    SRC_src_process = src_process;
    1.24 +    SRC_src_reset = src_reset;
    1.25 +    SRC_src_delete = src_delete;
    1.26 +    SRC_src_strerror = src_strerror;
    1.27 +#endif
    1.28  
    1.29      SRC_available = SDL_TRUE;
    1.30      return SDL_TRUE;