Package: k3b
Version: 2.0.3a-1
Severity: important
Tags: patch
User: pkg-multimedia-maintain...@lists.alioth.debian.org
Usertags: ffmpeg2.9

Dear Maintainer,

thanks for re-enabling the ffmpeg plugin, but unfortunately
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..07ee5bc
--- /dev/null
+++ b/debian/patches/ffmpeg-2.9.patch
@@ -0,0 +1,56 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2015-12-13>
+
+--- k3b-2.0.3a.orig/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
++++ k3b-2.0.3a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+@@ -329,6 +329,11 @@ int K3bFFMpegFile::fillOutputBuffer()
+         d->outputBufferPos = d->alignedOutputBuffer;
+         d->outputBufferSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+ 
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++        AVFrame *frame = av_frame_alloc();
++        int got_frame = 0;
++        int len = ::avcodec_decode_audio4(FFMPEG_CODEC(d->formatContext->streams[0]), frame, &got_frame, &d->packet);
++#else
+ #ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
+         int len = ::avcodec_decode_audio3(
+ #else
+@@ -347,14 +352,24 @@ int K3bFFMpegFile::fillOutputBuffer()
+ #else
+             d->packetData, d->packetSize );
+ #endif
++#endif
+ 
+         if( d->packetSize <= 0 || len < 0 )
+             ::av_free_packet( &d->packet );
+         if( len < 0 ) {
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++            av_frame_free(&frame);
++#endif
+             kDebug() << "(K3bFFMpegFile) decoding failed for " << m_filename;
+             return -1;
+         }
+ 
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++        d->outputBufferSize = av_get_bytes_per_sample(FFMPEG_CODEC(d->formatContext->streams[0])->sample_fmt) * FFMPEG_CODEC(d->formatContext->streams[0])->channels * frame->nb_samples;
++        memcpy(d->alignedOutputBuffer, frame->data[0], d->outputBufferSize);
++        av_frame_free(&frame);
++#endif
++
+         d->packetSize -= len;
+         d->packetData += len;
+     }
+@@ -420,9 +435,9 @@ K3bFFMpegFile* K3bFFMpegWrapper::open( c
+         // mp3 being one of them sadly. Most importantly: allow the libsndfile decoder to do
+         // its thing.
+         //
+-        if( file->type() == CODEC_ID_WMAV1 ||
+-            file->type() == CODEC_ID_WMAV2 ||
+-            file->type() == CODEC_ID_AAC )
++        if( file->type() == AV_CODEC_ID_WMAV1 ||
++            file->type() == AV_CODEC_ID_WMAV2 ||
++            file->type() == AV_CODEC_ID_AAC )
+ #endif
+             return file;
+     }
diff --git a/debian/patches/series b/debian/patches/series
index 9db785e..f150af0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 112_dont_require_mp3.diff
 113_initial_preference.diff
 cmake-duplicate-doc.diff
+ffmpeg-2.9.patch
_______________________________________________
pkg-kde-extras mailing list
pkg-kde-extras@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-kde-extras

Reply via email to