diff --git a/src/codecs/music_mpg123.c b/src/codecs/music_mpg123.c index bb7535f8..bf91fdcd 100644 --- a/src/codecs/music_mpg123.c +++ b/src/codecs/music_mpg123.c @@ -53,7 +53,11 @@ typedef struct { int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle); const char* (*mpg123_plain_strerror)(int errcode); void (*mpg123_rates)(const long **list, size_t *number); +#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */ int (*mpg123_read)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done ); +#else + int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done ); +#endif int (*mpg123_replace_reader_handle)( mpg123_handle *mh, MIX_SSIZE_T (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) ); off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence ); off_t (*mpg123_tell)( mpg123_handle *mh); @@ -100,7 +104,11 @@ static int MPG123_Load(void) FUNCTION_LOADER(mpg123_open_handle, int (*)(mpg123_handle *mh, void *iohandle)) FUNCTION_LOADER(mpg123_plain_strerror, const char* (*)(int errcode)) FUNCTION_LOADER(mpg123_rates, void (*)(const long **list, size_t *number)) +#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */ FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done )) +#else + FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done )) +#endif FUNCTION_LOADER(mpg123_replace_reader_handle, int (*)( mpg123_handle *mh, MIX_SSIZE_T (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) )) FUNCTION_LOADER(mpg123_seek, off_t (*)( mpg123_handle *mh, off_t sampleoff, int whence )) FUNCTION_LOADER(mpg123_tell, off_t (*)( mpg123_handle *mh))