Package: spek
Version: 0.8.2-3.2
Severity: important
Tags: patch
User: pkg-multimedia-maintain...@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 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..b123a96
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,33 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2015-11-02>
+
+--- spek-0.8.2.orig/src/spek-audio.cc
++++ spek-0.8.2/src/spek-audio.cc
+@@ -199,7 +199,7 @@ AudioFileImpl::AudioFileImpl(
+     this->packet.data = nullptr;
+     this->packet.size = 0;
+     this->offset = 0;
+-    this->frame = avcodec_alloc_frame();
++    this->frame = av_frame_alloc();
+     this->buffer_size = 0;
+     this->buffer = nullptr;
+     this->frames_per_interval = 0;
+@@ -215,7 +215,7 @@ AudioFileImpl::~AudioFileImpl()
+     if (this->frame) {
+         // TODO: Remove this check after Debian switches to libav 9.
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
+-        avcodec_free_frame(&this->frame);
++        av_frame_free(&this->frame);
+ #else
+         av_freep(&this->frame);
+ #endif
+@@ -255,7 +255,7 @@ int AudioFileImpl::read()
+ 
+     for (;;) {
+         while (this->packet.size > 0) {
+-            avcodec_get_frame_defaults(this->frame);
++            av_frame_unref(this->frame);
+             auto codec_context = this->format_context->streams[this->audio_stream]->codec;
+             int got_frame = 0;
+             int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet);
diff --git a/debian/patches/series b/debian/patches/series
index 8215fd9..d33812b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fix-compilation-with-libav-8.patch
 
+ffmpeg_2.9.patch

Reply via email to