Package: squeezelite
Version: 1.8-1
Severity: important
Tags: patch
User: [email protected]
Usertags: ffmpeg2.9

Dear Maintainer,

your package fails to build with the upcoming ffmpeg 2.9.
This bug will become release-critical at some point when the
ffmpeg2.9 transition gets closer.

Attached is a patch replacing the deprecated functionality.
It also works with ffmpeg 2.8.
Please apply this patch and forward it upstream, if necessary.

These changes have little regression potential.

Best regards,
Andreas


diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..19e38c1
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,49 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2015-11-02>
+
+--- squeezelite-1.8.orig/ffmpeg.c
++++ squeezelite-1.8/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");
diff --git a/debian/patches/series b/debian/patches/series
index fdf38dc..976f71b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 Makefile-tweaks.patch
 Makefile-portaudio.patch
+ffmpeg_2.9.patch

Reply via email to