Skip to content

Commit 64ab759

Browse files
committed
mpg123 loader: handle api (but not abi) change as of mpg123-1.26.0
thanks to Vitaly Novichkov for the notification
1 parent 8df5ea8 commit 64ab759

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/codecs/music_mpg123.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ typedef struct {
5353
int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
5454
const char* (*mpg123_plain_strerror)(int errcode);
5555
void (*mpg123_rates)(const long **list, size_t *number);
56+
#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
57+
int (*mpg123_read)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done );
58+
#else
5659
int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done );
60+
#endif
5761
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*) );
5862
off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence );
5963
off_t (*mpg123_tell)( mpg123_handle *mh);
@@ -100,7 +104,11 @@ static int MPG123_Load(void)
100104
FUNCTION_LOADER(mpg123_open_handle, int (*)(mpg123_handle *mh, void *iohandle))
101105
FUNCTION_LOADER(mpg123_plain_strerror, const char* (*)(int errcode))
102106
FUNCTION_LOADER(mpg123_rates, void (*)(const long **list, size_t *number))
107+
#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
108+
FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done ))
109+
#else
103110
FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done ))
111+
#endif
104112
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*) ))
105113
FUNCTION_LOADER(mpg123_seek, off_t (*)( mpg123_handle *mh, off_t sampleoff, int whence ))
106114
FUNCTION_LOADER(mpg123_tell, off_t (*)( mpg123_handle *mh))

0 commit comments

Comments
 (0)