package/mpd: bump version to 0.20
[buildroot-gz.git] / package / squeezelite / 0003-ffmpeg_2_9.patch
blobf69b829b383b3b0025dc5f2d80029147e96a2873
1 Fix compilation with ffmpeg >= 2.9
3 Downloaded from Debian:
4 https://sources.debian.net/src/squeezelite/1.8-3/debian/patches/ffmpeg_2.9.patch/
6 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
9 Description: Replace deprecated FFmpeg API
10 Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
11 Last-Update: <2015-11-02>
13 --- squeezelite-1.8.orig/ffmpeg.c
14 +++ squeezelite-1.8/ffmpeg.c
15 @@ -52,8 +52,8 @@ struct ff_s {
16 unsigned (* avcodec_version)(void);
17 AVCodec * (* avcodec_find_decoder)(int);
18 int attribute_align_arg (* avcodec_open2)(AVCodecContext *, const AVCodec *, AVDictionary **);
19 - AVFrame * (* avcodec_alloc_frame)(void);
20 - void (* avcodec_free_frame)(AVFrame **);
21 + AVFrame * (* av_frame_alloc)(void);
22 + void (* av_frame_free)(AVFrame **);
23 int attribute_align_arg (* avcodec_decode_audio4)(AVCodecContext *, AVFrame *, int *, const AVPacket *);
24 // ffmpeg symbols to be dynamically loaded from libavformat
25 unsigned (* avformat_version)(void);
26 @@ -324,7 +324,7 @@ static decode_state ff_decode(void) {
28 AVCODEC(ff, open2, ff->codecC, codec, NULL);
30 - ff->frame = AVCODEC(ff, alloc_frame);
31 + ff->frame = AV(ff, frame_alloc);
33 ff->avpkt = AV(ff, malloc, sizeof(AVPacket));
34 if (ff->avpkt == NULL) {
35 @@ -520,9 +520,9 @@ static void _free_ff_data(void) {
36 if (ff->frame) {
37 // ffmpeg version dependant free function
38 #if !LINKALL
39 - ff->avcodec_free_frame ? AVCODEC(ff, free_frame, &ff->frame) : AV(ff, freep, &ff->frame);
40 + ff->av_frame_free ? AV(ff, frame_free, &ff->frame) : AV(ff, freep, &ff->frame);
41 #elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,28,0)
42 - AVCODEC(ff, free_frame, &ff->frame);
43 + AV(ff, frame_free, &ff->frame);
44 #else
45 AV(ff, freep, &ff->frame);
46 #endif
47 @@ -607,8 +607,8 @@ static bool load_ff() {
48 ff->avcodec_version = dlsym(handle_codec, "avcodec_version");
49 ff->avcodec_find_decoder = dlsym(handle_codec, "avcodec_find_decoder");
50 ff->avcodec_open2 = dlsym(handle_codec, "avcodec_open2");
51 - ff->avcodec_alloc_frame = dlsym(handle_codec, "avcodec_alloc_frame");
52 - ff->avcodec_free_frame = dlsym(handle_codec, "avcodec_free_frame");
53 + ff->av_frame_alloc = dlsym(handle_codec, "av_frame_alloc");
54 + ff->av_frame_free = dlsym(handle_codec, "av_frame_free");
55 ff->avcodec_decode_audio4 = dlsym(handle_codec, "avcodec_decode_audio4");
56 ff->av_init_packet = dlsym(handle_codec, "av_init_packet");
57 ff->av_free_packet = dlsym(handle_codec, "av_free_packet");