From: Daniel Kirchner Date: Wed, 9 Mar 2016 08:17:09 +0000 (+0100) Subject: a52: Fix usage of obsoleted avcodec_*_frame() functions X-Git-Tag: v1.1.1~1 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=bc090af8b7d1a42627949a94e022f3d34f3ac5ee;p=alsa-plugins.git a52: Fix usage of obsoleted avcodec_*_frame() functions pcm_a52.c uses avcodec_alloc_frame and avcodec_free_frame that have been replaced by av_frame_alloc and av_frame_free in recent versions of libavcodec. The following patch should fix this while remaining backwards compatible. Signed-off-by: Takashi Iwai --- diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 6fad77d..564dd73 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -62,6 +62,11 @@ #define AV_CODEC_ID_AC3 CODEC_ID_AC3 #endif +#if LIBAVCODEC_VERSION_INT < 0x371c01 +#define av_frame_alloc avcodec_alloc_frame +#define av_frame_free avcodec_free_frame +#endif + struct a52_ctx { snd_pcm_ioplug_t io; snd_pcm_t *slave; @@ -513,7 +518,7 @@ static void a52_free(struct a52_ctx *rec) rec->inbuf = NULL; } #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0) - avcodec_free_frame(&rec->frame); + av_frame_free(&rec->frame); #else av_freep(&rec->frame); #endif @@ -557,7 +562,7 @@ static int alloc_input_buffer(snd_pcm_ioplug_t *io) { struct a52_ctx *rec = io->private_data; #ifdef USE_AVCODEC_FRAME - rec->frame = avcodec_alloc_frame(); + rec->frame = av_frame_alloc(); if (!rec->frame) return -ENOMEM; if (av_samples_alloc(rec->frame->data, rec->frame->linesize,