diff -up xmms2-0.7DrNo/src/plugins/avcodec/avcodec.c.ffmpeg xmms2-0.7DrNo/src/plugins/avcodec/avcodec.c --- xmms2-0.7DrNo/src/plugins/avcodec/avcodec.c.ffmpeg 2010-02-19 18:43:54.000000000 +0100 +++ xmms2-0.7DrNo/src/plugins/avcodec/avcodec.c 2011-08-27 18:04:03.000000000 +0200 @@ -160,7 +164,11 @@ xmms_avcodec_init (xmms_xform_t *xform) goto err; } +#if LIBAVCODEC_VERSION_MAJOR < 53 if (codec->type != CODEC_TYPE_AUDIO) { +#else + if (codec->type != AVMEDIA_TYPE_AUDIO) { +#endif XMMS_DBG ("Codec '%s' found but its type is not audio", data->codec_id); goto err; } @@ -332,9 +340,18 @@ xmms_avcodec_read (xmms_xform_t *xform, } outbufsize = sizeof (outbuf); +#if FF_API_AUDIO_OLD bytes_read = avcodec_decode_audio2 (data->codecctx, (short *) outbuf, &outbufsize, data->buffer_pos, data->buffer_length); +#else + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = (uint8_t *) data->buffer_pos; + avpkt.size = data->buffer_length; + bytes_read = avcodec_decode_audio3 (data->codecctx, outbuf, + &outbufsize, &avpkt); +#endif if (bytes_read < 0 || bytes_read > data->buffer_length) { XMMS_DBG ("Error decoding data!");