summaryrefslogtreecommitdiff
blob: 111ee70c87740d46920ed45659969ab65695658b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 3f60efe3dbab8e9d2c07a7b183fd009b3c999d60 Mon Sep 17 00:00:00 2001
From: Jamie Heilman <jamie@audible.transient.net>
Date: Sun, 8 May 2016 19:34:36 +0000
Subject: [PATCH] ffmpeg/libav: support libavcodec API 55 and later

With FFmpeg 1.0 and libav 10, AVCodecContext.{get,release}_buffer()
were deprecated; the new default AVCodecContext.get_buffer2()
implementation works fine for us.
---
 src/decoder/dec_lavc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/decoder/dec_lavc.c b/src/decoder/dec_lavc.c
index e2c81c6..5268a64 100644
--- a/src/decoder/dec_lavc.c
+++ b/src/decoder/dec_lavc.c
@@ -280,10 +280,12 @@ lavc_decoder_open(decoder_t * dec, char * filename) {
 		return DECODER_OPEN_BADLIB;
 
 	pd->avCodecCtx = pd->avFormatCtx->streams[pd->audioStream]->codec;
+#if LIBAVCODEC_VERSION_MAJOR < 55
 #if LIBAVCODEC_VERSION_MAJOR >= 53
 	pd->avCodecCtx->get_buffer = avcodec_default_get_buffer;
 	pd->avCodecCtx->release_buffer = avcodec_default_release_buffer;
 #endif /* LIBAVCODEC_VERSION_MAJOR >= 53 */
+#endif /* LIBAVCODEC_VERSION_MAJOR < 55 */
 
 	pd->time_base = pd->avFormatCtx->streams[pd->audioStream]->time_base;