X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Fmp3_libavcodec.c;h=9a528c1e7fd3f2688632074c08da1031e2aa9adc;hb=1dfbe19da9d3e1be38522d07985682f6fae1e669;hp=3c93dfba18fcbf03c11cc6113474d9660a5e4097;hpb=986d60fc6068356477327f742c0e41827e76a3fa;p=picodrive.git diff --git a/platform/common/mp3_libavcodec.c b/platform/common/mp3_libavcodec.c index 3c93dfb..9a528c1 100644 --- a/platform/common/mp3_libavcodec.c +++ b/platform/common/mp3_libavcodec.c @@ -16,6 +16,11 @@ #include "../libpicofe/lprintf.h" #include "mp3.h" +#if LIBAVCODEC_VERSION_MAJOR < 55 +#define AVCodecID CodecID +#define AV_CODEC_ID_MP3 CODEC_ID_MP3 +#endif + static AVCodecContext *ctx; /* avoid compile time linking to libavcodec due to huge list of it's deps.. @@ -91,10 +96,10 @@ int mp3dec_decode(FILE *f, int *file_pos, int file_len) return 0; } -int mp3dec_start(void) +int mp3dec_start(FILE *f, int fpos_start) { void (*avcodec_register_all)(void); - AVCodec *(*avcodec_find_decoder)(enum CodecID id); + AVCodec *(*avcodec_find_decoder)(enum AVCodecID id); AVCodecContext *(*avcodec_alloc_context)(void); int (*avcodec_open)(AVCodecContext *avctx, AVCodec *codec); void (*av_free)(void *ptr); @@ -137,8 +142,7 @@ int mp3dec_start(void) //avcodec_init(); avcodec_register_all(); - // AV_CODEC_ID_MP3 ? - codec = avcodec_find_decoder(CODEC_ID_MP3); + codec = avcodec_find_decoder(AV_CODEC_ID_MP3); if (codec == NULL) { lprintf("mp3dec: codec missing\n"); return -1;