Prepare for new FFMpeg. Will work on both old and new, but the bump should

happen now, as the patch it uses routines we have in current FFMpeg already.

Initial prodding by brad@
This commit is contained in:
zhuk 2014-08-12 08:06:28 +00:00
parent 3328f8e8bb
commit b3c4c80949
2 changed files with 39 additions and 14 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.1.1.1 2014/07/09 16:40:41 zhuk Exp $
# $OpenBSD: Makefile,v 1.2 2014/08/12 08:06:28 zhuk Exp $
COMMENT = CD/DVD creator
DISTNAME = k3b-2.0.2
CATEGORIES = multimedia
REVISION = 0
# bump away from KDE3 version
SHARED_LIBS = k3blib 50.0

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-plugins_decoder_ffmpeg_k3bffmpegwrapper_cpp,v 1.2 2014/07/11 21:02:05 zhuk Exp $
$OpenBSD: patch-plugins_decoder_ffmpeg_k3bffmpegwrapper_cpp,v 1.3 2014/08/12 08:06:28 zhuk Exp $
Fixed compilation with new FFMPEG.
Upstream commits:
Partly from Upstream commits:
2f845b34badb614882b7e38ac38b00041ac2832d
6f34e14b28d2f9103151c6ba08b3bb40448ffe46
(last one via Debian)
--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.orig Sat Jan 15 21:47:29 2011
+++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp Fri Jul 11 20:24:07 2014
--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.orig Sat Jan 15 23:47:29 2011
+++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp Tue Aug 12 11:57:46 2014
@@ -33,6 +33,11 @@ extern "C" {
#endif
}
@ -18,7 +18,7 @@ Upstream commits:
#include <string.h>
#include <klocale.h>
@@ -88,7 +93,11 @@ bool K3bFFMpegFile::open()
@@ -88,14 +93,22 @@ bool K3bFFMpegFile::open()
close();
// open the file
@ -30,7 +30,18 @@ Upstream commits:
if( err < 0 ) {
kDebug() << "(K3bFFMpegFile) unable to open " << m_filename << " with error " << err;
return false;
@@ -109,7 +118,13 @@ bool K3bFFMpegFile::open()
}
// analyze the streams
+#if LIBAVFORMAT_VERSION_MAJOR >= 56
+ ::avformat_find_stream_info( d->formatContext, NULL );
+#else
::av_find_stream_info( d->formatContext );
+#endif
// we only handle files containing one audio stream
if( d->formatContext->nb_streams != 1 ) {
@@ -109,7 +122,13 @@ bool K3bFFMpegFile::open()
#else
::AVCodecContext* codecContext = d->formatContext->streams[0]->codec;
#endif
@ -45,7 +56,7 @@ Upstream commits:
kDebug() << "(K3bFFMpegFile) not a simple audio stream: " << m_filename;
return false;
}
@@ -123,7 +138,11 @@ bool K3bFFMpegFile::open()
@@ -123,7 +142,11 @@ bool K3bFFMpegFile::open()
// open the codec on our context
kDebug() << "(K3bFFMpegFile) found codec for " << m_filename;
@ -57,7 +68,7 @@ Upstream commits:
kDebug() << "(K3bFFMpegDecoderFactory) could not open codec.";
return false;
}
@@ -137,7 +156,11 @@ bool K3bFFMpegFile::open()
@@ -137,7 +160,11 @@ bool K3bFFMpegFile::open()
}
// dump some debugging info
@ -69,7 +80,20 @@ Upstream commits:
return true;
}
@@ -225,8 +248,11 @@ QString K3bFFMpegFile::typeComment() const
@@ -159,8 +186,12 @@ void K3bFFMpegFile::close()
}
if( d->formatContext ) {
+#if LIBAVFORMAT_VERSION_MAJOR >= 56
+ ::avformat_close_input( &d->formatContext );
+#else
::av_close_input_file( d->formatContext );
d->formatContext = 0;
+#endif
}
}
@@ -225,8 +256,11 @@ QString K3bFFMpegFile::typeComment() const
QString K3bFFMpegFile::title() const
{
// FIXME: is this UTF8 or something??
@ -83,7 +107,7 @@ Upstream commits:
else
return QString();
}
@@ -235,8 +261,11 @@ QString K3bFFMpegFile::title() const
@@ -235,8 +269,11 @@ QString K3bFFMpegFile::title() const
QString K3bFFMpegFile::author() const
{
// FIXME: is this UTF8 or something??
@ -97,7 +121,7 @@ Upstream commits:
else
return QString();
}
@@ -245,8 +274,11 @@ QString K3bFFMpegFile::author() const
@@ -245,8 +282,11 @@ QString K3bFFMpegFile::author() const
QString K3bFFMpegFile::comment() const
{
// FIXME: is this UTF8 or something??
@ -111,7 +135,7 @@ Upstream commits:
else
return QString();
}
@@ -309,8 +341,13 @@ int K3bFFMpegFile::fillOutputBuffer()
@@ -309,8 +349,13 @@ int K3bFFMpegFile::fillOutputBuffer()
#if LIBAVCODEC_VERSION_MAJOR < 52
int len = ::avcodec_decode_audio(
#else
@ -125,7 +149,7 @@ Upstream commits:
#ifdef FFMPEG_BUILD_PRE_4629
&d->formatContext->streams[0]->codec,
#else
@@ -318,7 +355,11 @@ int K3bFFMpegFile::fillOutputBuffer()
@@ -318,7 +363,11 @@ int K3bFFMpegFile::fillOutputBuffer()
#endif
(short*)d->alignedOutputBuffer,
&d->outputBufferSize,