summaryrefslogtreecommitdiffstats
path: root/package/squeezelite/0003-Replace-deprecated-FFmpeg-API.patch
blob: 74d8f1be5562f31c526f00ef281d1ce17f09479f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From cce6a0378ac319b87d2545d73f593d440bf686f5 Mon Sep 17 00:00:00 2001
From: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Date: Sat, 18 Aug 2018 13:25:23 +0200
Subject: [PATCH] Replace deprecated FFmpeg API

Fixes compilation with ffmpeg >= 2.9.

Downloaded from Debian:
https://sources.debian.org/src/squeezelite/1.8-4.1/debian/patches/ffmpeg_2.9.patch/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 ffmpeg.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 279f31d..bc9136c 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -52,8 +52,8 @@ struct ff_s {
 	unsigned (* avcodec_version)(void);
 	AVCodec * (* avcodec_find_decoder)(int);
 	int attribute_align_arg (* avcodec_open2)(AVCodecContext *, const AVCodec *, AVDictionary **);
-	AVFrame * (* avcodec_alloc_frame)(void);
-	void (* avcodec_free_frame)(AVFrame **);
+	AVFrame * (* av_frame_alloc)(void);
+	void (* av_frame_free)(AVFrame **);
 	int attribute_align_arg (* avcodec_decode_audio4)(AVCodecContext *, AVFrame *, int *, const AVPacket *);
 	// ffmpeg symbols to be dynamically loaded from libavformat
 	unsigned (* avformat_version)(void);
@@ -324,7 +324,7 @@ static decode_state ff_decode(void) {
 
 		AVCODEC(ff, open2, ff->codecC, codec, NULL);
 
-		ff->frame = AVCODEC(ff, alloc_frame);
+		ff->frame = AV(ff, frame_alloc);
 
 		ff->avpkt = AV(ff, malloc, sizeof(AVPacket));
 		if (ff->avpkt == NULL) {
@@ -520,9 +520,9 @@ static void _free_ff_data(void) {
 	if (ff->frame) {
 		// ffmpeg version dependant free function
 #if !LINKALL
-		ff->avcodec_free_frame ? AVCODEC(ff, free_frame, &ff->frame) : AV(ff, freep, &ff->frame);
+		ff->av_frame_free ? AV(ff, frame_free, &ff->frame) : AV(ff, freep, &ff->frame);
 #elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,28,0)
-		AVCODEC(ff, free_frame, &ff->frame);
+		AV(ff, frame_free, &ff->frame);
 #else
 		AV(ff, freep, &ff->frame);
 #endif
@@ -607,8 +607,8 @@ static bool load_ff() {
 	ff->avcodec_version = dlsym(handle_codec, "avcodec_version");
 	ff->avcodec_find_decoder = dlsym(handle_codec, "avcodec_find_decoder");
 	ff->avcodec_open2 = dlsym(handle_codec, "avcodec_open2");
-	ff->avcodec_alloc_frame = dlsym(handle_codec, "avcodec_alloc_frame");
-	ff->avcodec_free_frame = dlsym(handle_codec, "avcodec_free_frame");
+	ff->av_frame_alloc = dlsym(handle_codec, "av_frame_alloc");
+	ff->av_frame_free = dlsym(handle_codec, "av_frame_free");
 	ff->avcodec_decode_audio4 = dlsym(handle_codec, "avcodec_decode_audio4");
 	ff->av_init_packet = dlsym(handle_codec, "av_init_packet");
 	ff->av_free_packet = dlsym(handle_codec, "av_free_packet");
-- 
2.18.0

OpenPOWER on IntegriCloud