From a2d628b457b5745935dcc52331dc64928f279072 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 11 Dec 2016 03:47:00 +0100 Subject: [PATCH] src/io/source_avcodec.c: add backward compatibility for libavcodec55 --- src/io/source_avcodec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c index 9df4e6d1..ed7a6199 100644 --- a/src/io/source_avcodec.c +++ b/src/io/source_avcodec.c @@ -38,6 +38,14 @@ #include #include +// backward compatibility with libavcodec55 +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55,28,1) +#warning "libavcodec55 is deprecated" +#define av_frame_alloc avcodec_alloc_frame +#define av_frame_free avcodec_free_frame +#define av_packet_unref av_free_packet +#endif + #include "aubio_priv.h" #include "fvec.h" #include "fmat.h" @@ -507,11 +515,7 @@ uint_t aubio_source_avcodec_close(aubio_source_avcodec_t * s) { avformat_free_context(s->avFormatCtx); s->avFormatCtx = NULL; } -#if FF_API_LAVF_AVCTX av_packet_unref(&s->avPacket); -#else - av_free_packet(&s->avPacket); -#endif return AUBIO_OK; } -- 2.11.0