Bug#803800: avbin: FTBFS with FFmpeg 2.9
Package: avbin
Version: 7-5
Severity: important
Tags: patch
User: pkg-multimedia-maintainers@lists.alioth.debian.org
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 are non-trivial and should be runtime-tested.
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..7a2b010
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,58 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
+Last-Update: <2015-11-02>
+
+--- avbin-7.orig/src/avbin.c
++++ avbin-7/src/avbin.c
+@@ -291,7 +291,7 @@ AVbinStream *avbin_open_stream(AVbinFile
+ stream->codec_context = codec_context;
+ stream->type = codec_context->codec_type;
+ if (stream->type == AVMEDIA_TYPE_VIDEO)
+- stream->frame = avcodec_alloc_frame();
++ stream->frame = av_frame_alloc();
+ else
+ stream->frame = NULL;
+ return stream;
+@@ -336,16 +336,21 @@ int avbin_decode_audio(AVbinStream *stre
+ return AVBIN_RESULT_ERROR;
+
+ AVPacket avpkt;
++ int got_frame = 0;
+ av_init_packet(&avpkt);
+ avpkt.data = data_in;
+ avpkt.size = size_in;
+- used = avcodec_decode_audio3(stream->codec_context,
+- (int16_t *) data_out, size_out,
++ used = avcodec_decode_audio4(stream->codec_context,
++ stream->frame, &got_frame,
+ &avpkt);
+
+- if (used < 0)
++ if (used < 0 || !got_frame)
+ return AVBIN_RESULT_ERROR;
+
++ *size_out = av_get_bytes_per_sample(stream->codec_context->sample_fmt)
++ * stream->codec_context->channels * stream->frame->nb_samples;
++ memcpy(data_out, stream->frame->data[0], *size_out);
++
+ return used;
+ }
+
+@@ -375,7 +380,7 @@ int avbin_decode_video(AVbinStream *stre
+ return AVBIN_RESULT_ERROR;
+
+
+- avpicture_fill(&picture_rgb, data_out, PIX_FMT_RGB24, width, height);
++ avpicture_fill(&picture_rgb, data_out, AV_PIX_FMT_RGB24, width, height);
+
+ static int sws_flags = SWS_BICUBIC;
+ static struct SwsContext *img_convert_ctx;
+@@ -385,7 +390,7 @@ int avbin_decode_video(AVbinStream *stre
+ stream->codec_context->pix_fmt,
+ width,
+ height,
+- PIX_FMT_RGB24,
++ AV_PIX_FMT_RGB24,
+ sws_flags, NULL, NULL, NULL);
+
+ sws_scale( img_convert_ctx,
diff --git a/debian/patches/series b/debian/patches/series
index 9bca9a1..b1a9242 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
libav.patch
+ffmpeg_2.9.patch
Reply to: