rev 20603 - in kde-extras/k3b/trunk/debian: . patches

Pino Toscano pino at moszumanska.debian.org
Sun Jul 17 08:00:57 UTC 2016


Author: pino
Date: 2016-07-17 08:00:55 +0000 (Sun, 17 Jul 2016)
New Revision: 20603

Added:
   kde-extras/k3b/trunk/debian/patches/upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch
Modified:
   kde-extras/k3b/trunk/debian/changelog
   kde-extras/k3b/trunk/debian/patches/series
Log:
build with FFmpeg 2.9+ (#807853)

backport upstream commit 840121f0c0ecb5c1fc6324653b795fb7cba60deb


Modified: kde-extras/k3b/trunk/debian/changelog
===================================================================
--- kde-extras/k3b/trunk/debian/changelog	2016-07-10 16:11:55 UTC (rev 20602)
+++ kde-extras/k3b/trunk/debian/changelog	2016-07-17 08:00:55 UTC (rev 20603)
@@ -2,6 +2,9 @@
 
   [ Pino Toscano ]
   * Drop menu file and its pixmap, since k3b already provides a .desktop file.
+  * Backport upstream commit 840121f0c0ecb5c1fc6324653b795fb7cba60deb to fix
+    build with FFmpeg 2.9 and greater; patch
+    upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch (Closes: #807853)
 
  -- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>  Tue, 19 Jan 2016 08:28:23 +0100
 

Modified: kde-extras/k3b/trunk/debian/patches/series
===================================================================
--- kde-extras/k3b/trunk/debian/patches/series	2016-07-10 16:11:55 UTC (rev 20602)
+++ kde-extras/k3b/trunk/debian/patches/series	2016-07-17 08:00:55 UTC (rev 20603)
@@ -5,3 +5,4 @@
 112_dont_require_mp3.diff
 113_initial_preference.diff
 cmake-duplicate-doc.diff
+upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch

Added: kde-extras/k3b/trunk/debian/patches/upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch
===================================================================
--- kde-extras/k3b/trunk/debian/patches/upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch	                        (rev 0)
+++ kde-extras/k3b/trunk/debian/patches/upstream_Fixed-compilation-on-newer-ffmpeg-libav.patch	2016-07-17 08:00:55 UTC (rev 20603)
@@ -0,0 +1,142 @@
+From 840121f0c0ecb5c1fc6324653b795fb7cba60deb Mon Sep 17 00:00:00 2001
+From: Leslie Zhai <xiangzhai83 at gmail.com>
+Date: Fri, 15 Jul 2016 10:19:20 +0800
+Subject: [PATCH] Fixed compilation on newer ffmpeg/libav
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Oldřich Jedlička took the API example and modified the code to match it.
+The code compiles fine with libav-11.2 with no deprecation warnings.
+
+REVIEW: 122569
+CCMAIL: debian at kitterman.com
+---
+ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp | 60 ++++++++++++++++++++++++-----
+ 1 file changed, 50 insertions(+), 10 deletions(-)
+
+diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+index 5451fd3..2f80fd6 100644
+--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
++++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+@@ -86,8 +86,12 @@ public:
+     K3b::Msf length;
+ 
+     // for decoding. ffmpeg requires 16-byte alignment.
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++    ::AVFrame* frame;
++#else
+     char outputBuffer[AVCODEC_MAX_AUDIO_FRAME_SIZE + 15];
+     char* alignedOutputBuffer;
++#endif
+     char* outputBufferPos;
+     int outputBufferSize;
+     ::AVPacket packet;
+@@ -102,14 +106,29 @@ K3bFFMpegFile::K3bFFMpegFile( const QString& filename )
+     d = new Private;
+     d->formatContext = 0;
+     d->codec = 0;
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++#  if LIBAVCODEC_BUILD < AV_VERSION_INT(55,28,1)
++    d->frame = avcodec_alloc_frame();
++#  else
++    d->frame = av_frame_alloc();
++#  endif
++#else
+     int offset = 0x10 - (reinterpret_cast<intptr_t>(&d->outputBuffer) & 0xf);
+     d->alignedOutputBuffer = &d->outputBuffer[offset];
++#endif
+ }
+ 
+ 
+ K3bFFMpegFile::~K3bFFMpegFile()
+ {
+     close();
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++#  if LIBAVCODEC_BUILD < AV_VERSION_INT(55,28,1)
++    av_free(d->frame);
++#  else
++    av_frame_free(&d->frame);
++#  endif
++#endif
+     delete d;
+ }
+ 
+@@ -326,26 +345,36 @@ int K3bFFMpegFile::fillOutputBuffer()
+             return 0;
+         }
+ 
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++        int gotFrame = 0;
++        int len = ::avcodec_decode_audio4(
++#else
+         d->outputBufferPos = d->alignedOutputBuffer;
+         d->outputBufferSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-
+-#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
++#  ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
+         int len = ::avcodec_decode_audio3(
+-#else
+-#  ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2
+-        int len = ::avcodec_decode_audio2(
+ #  else
++#    ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2
++        int len = ::avcodec_decode_audio2(
++#    else
+         int len = ::avcodec_decode_audio(
++#    endif
+ #  endif
+ #endif
+ 
+             FFMPEG_CODEC(d->formatContext->streams[0]),
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++            d->frame,
++            &gotFrame,
++            &d->packet );
++#else
+             (short*)d->alignedOutputBuffer,
+             &d->outputBufferSize,
+-#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
++#  ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
+             &d->packet );
+-#else
++#  else
+             d->packetData, d->packetSize );
++#  endif
+ #endif
+ 
+         if( d->packetSize <= 0 || len < 0 )
+@@ -355,6 +384,17 @@ int K3bFFMpegFile::fillOutputBuffer()
+             return -1;
+         }
+ 
++#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
++        if ( gotFrame ) {
++            d->outputBufferSize = ::av_samples_get_buffer_size(
++                NULL,
++                FFMPEG_CODEC(d->formatContext->streams[0])->channels,
++                d->frame->nb_samples,
++                FFMPEG_CODEC(d->formatContext->streams[0])->sample_fmt,
++                1 );
++            d->outputBufferPos = reinterpret_cast<char*>( d->frame->data[0] );
++        }
++#endif
+         d->packetSize -= len;
+         d->packetData += len;
+     }
+@@ -420,9 +460,9 @@ K3bFFMpegFile* K3bFFMpegWrapper::open( const QString& filename ) const
+         // 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;
+     }
+-- 
+2.8.1
+




More information about the pkg-kde-commits mailing list