Author: rdieter
Update of /cvs/free/rpms/k3b-extras-freeworld/F-19
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv11123
Modified Files:
k3b-extras-freeworld.spec
Added Files:
0330-CMake-checks-for-FFmpeg-API-changes.patch
0331-Introduce-a-macro-for-referencing-the-ffmpeg-codec.patch
k3b-ffmpeg-review-113295-1.patch
Log Message:
sync w/devel branch
0330-CMake-checks-for-FFmpeg-API-changes.patch:
CMakeLists.txt | 47 +++++++++++++++++++++
config-k3b.h.cmake | 11 +++++
plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp | 61 +++++++++++++++-------------
3 files changed, 91 insertions(+), 28 deletions(-)
--- NEW FILE 0330-CMake-checks-for-FFmpeg-API-changes.patch ---
diff -up k3b-2.0.2/CMakeLists.txt.0330 k3b-2.0.2/CMakeLists.txt
--- k3b-2.0.2/CMakeLists.txt.0330 2011-01-15 14:52:01.000000000 -0600
+++ k3b-2.0.2/CMakeLists.txt 2013-11-01 08:15:37.219798696 -0500
@@ -100,6 +100,53 @@ if(K3B_BUILD_FFMPEG_DECODER_PLUGIN)
"Needed for the K3b FFmpeg decoder plugin which can decode virtually all audio
types."
"http://ffmpeg.org/"
FALSE "" "")
+ if(FFMPEG_FOUND)
+ include(CMakePushCheckState)
+ cmake_push_check_state()
+
+ if(CMAKE_COMPILER_IS_GNUCC)
+ # FindKDE4Internal.cmake screws things up
+ set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c99)
+ endif(CMAKE_COMPILER_IS_GNUCC)
+
+ if(FFMPEG_INCLUDE_DIR_OLD_STYLE)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}
${FFMPEG_INCLUDE_DIR_OLD_STYLE})
+ set(FFMPEG_HEADERS ffmpeg/avcodec.h ffmpeg/avformat.h)
+ else(FFMPEG_INCLUDE_DIR_OLD_STYLE)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${FFMPEG_INCLUDE_DIR}
${FFMPEG_INCLUDE_DIRS})
+ set(FFMPEG_HEADERS libavcodec/avcodec.h libavformat/avformat.h)
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-DNEWFFMPEGAVCODECPATH)
+ endif(FFMPEG_INCLUDE_DIR_OLD_STYLE)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${FFMPEG_LIBRARIES})
+
+ check_symbol_exists(avformat_open_input "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVFORMAT_OPEN_INPUT)
+ check_symbol_exists(av_dump_format "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AV_DUMP_FORMAT)
+ check_symbol_exists(avformat_find_stream_info "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVFORMAT_FIND_STREAM_INFO)
+ check_symbol_exists(avformat_close_input "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVFORMAT_CLOSE_INPUT)
+ check_symbol_exists(avcodec_open2 "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVCODEC_OPEN2)
+ check_symbol_exists(avcodec_decode_audio2 "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2)
+ check_symbol_exists(avcodec_decode_audio3 "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3)
+ check_symbol_exists(avcodec_decode_audio4 "${FFMPEG_HEADERS}"
HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4)
+ include(CheckCSourceCompiles)
+ check_c_source_compiles("
+ #ifdef NEWFFMPEGAVCODECPATH
+ #include <libavcodec/avcodec.h>
+ #else
+ #include <ffmpeg/avcodec.h>
+ #endif
+ int main() { enum AVMediaType t = AVMEDIA_TYPE_UNKNOWN; return 0; }
+ " HAVE_FFMPEG_AVMEDIA_TYPE)
+ check_c_source_compiles("
+ #ifdef NEWFFMPEGAVCODECPATH
+ #include <libavcodec/avcodec.h>
+ #else
+ #include <ffmpeg/avcodec.h>
+ #endif
+ int main() { enum CodecID t = CODEC_ID_MP3; return 0; }
+ " HAVE_FFMPEG_CODEC_MP3)
+
+ cmake_pop_check_state()
+ endif(FFMPEG_FOUND)
endif(K3B_BUILD_FFMPEG_DECODER_PLUGIN)
if(K3B_BUILD_FLAC_DECODER_PLUGIN)
diff -up k3b-2.0.2/config-k3b.h.cmake.0330 k3b-2.0.2/config-k3b.h.cmake
--- k3b-2.0.2/config-k3b.h.cmake.0330 2013-11-01 08:15:37.219798696 -0500
+++ k3b-2.0.2/config-k3b.h.cmake 2013-11-01 08:16:20.375033275 -0500
@@ -22,3 +22,14 @@
#cmakedefine HAVE_BYTESWAP_H 1
#cmakedefine WORDS_BIGENDIAN 1
+
+#cmakedefine HAVE_FFMPEG_AVFORMAT_OPEN_INPUT
+#cmakedefine HAVE_FFMPEG_AV_DUMP_FORMAT
+#cmakedefine HAVE_FFMPEG_AVFORMAT_FIND_STREAM_INFO
+#cmakedefine HAVE_FFMPEG_AVFORMAT_CLOSE_INPUT
+#cmakedefine HAVE_FFMPEG_AVCODEC_OPEN2
+#cmakedefine HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2
+#cmakedefine HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
+#cmakedefine HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4
+#cmakedefine HAVE_FFMPEG_AVMEDIA_TYPE
+#cmakedefine HAVE_FFMPEG_CODEC_MP3
diff -up k3b-2.0.2/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.0330
k3b-2.0.2/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
--- k3b-2.0.2/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.0330 2013-11-01
08:15:37.215798767 -0500
+++ k3b-2.0.2/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp 2013-11-01 08:15:37.219798696
-0500
@@ -42,6 +42,28 @@ extern "C" {
#define FFMPEG_BUILD_PRE_4629
#endif
+#ifndef HAVE_FFMPEG_AVFORMAT_OPEN_INPUT
+// this works because the parameters/options are not used
+# define avformat_open_input(c,s,f,o) av_open_input_file(c,s,f,0,o)
+#endif
+#ifndef HAVE_FFMPEG_AV_DUMP_FORMAT
+# define av_dump_format(c,x,f,y) dump_format(c,x,f,y)
+#endif
+#ifndef HAVE_FFMPEG_AVFORMAT_FIND_STREAM_INFO
+# define avformat_find_stream_info(c,o) av_find_stream_info(c)
+#endif
+#ifndef HAVE_FFMPEG_AVFORMAT_CLOSE_INPUT
+# define avformat_close_input(c) av_close_input_file(*c)
+#endif
+#ifndef HAVE_FFMPEG_AVCODEC_OPEN2
+# define avcodec_open2(a,c,o) avcodec_open(a,c)
+#endif
+#ifndef HAVE_FFMPEG_AVMEDIA_TYPE
+# define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
+#endif
+#ifndef HAVE_FFMPEG_CODEC_MP3
+# define CODEC_ID_MP3 CODEC_ID_MP3LAME
+#endif
K3bFFMpegWrapper* K3bFFMpegWrapper::s_instance = 0;
@@ -88,18 +110,14 @@ bool K3bFFMpegFile::open()
close();
// open the file
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,2,0)
int err = ::avformat_open_input( &d->formatContext, m_filename.toLocal8Bit(),
0, 0 );
-#else
- int err = ::av_open_input_file( &d->formatContext, m_filename.toLocal8Bit(),
0, 0, 0 );
-#endif
if( err < 0 ) {
kDebug() << "(K3bFFMpegFile) unable to open " << m_filename
<< " with error " << err;
return false;
}
// analyze the streams
- ::av_find_stream_info( d->formatContext );
+ ::avformat_find_stream_info( d->formatContext, 0 );
// we only handle files containing one audio stream
if( d->formatContext->nb_streams != 1 ) {
@@ -113,12 +131,7 @@ bool K3bFFMpegFile::open()
#else
::AVCodecContext* codecContext = d->formatContext->streams[0]->codec;
#endif
- if( codecContext->codec_type !=
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
- AVMEDIA_TYPE_AUDIO)
-#else
- CODEC_TYPE_AUDIO)
-#endif
+ if( codecContext->codec_type != AVMEDIA_TYPE_AUDIO)
{
kDebug() << "(K3bFFMpegFile) not a simple audio stream: "
<< m_filename;
return false;
@@ -133,7 +146,7 @@ bool K3bFFMpegFile::open()
// open the codec on our context
kDebug() << "(K3bFFMpegFile) found codec for " << m_filename;
- if( ::avcodec_open( codecContext, d->codec ) < 0 ) {
+ if( ::avcodec_open2( codecContext, d->codec, 0 ) < 0 ) {
kDebug() << "(K3bFFMpegDecoderFactory) could not open codec.";
return false;
}
@@ -147,11 +160,7 @@ bool K3bFFMpegFile::open()
}
// dump some debugging info
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,2,0)
::av_dump_format( d->formatContext, 0, m_filename.toLocal8Bit(), 0 );
-#else
- ::dump_format( d->formatContext, 0, m_filename.toLocal8Bit(), 0 );
-#endif
return true;
}
@@ -173,7 +182,7 @@ void K3bFFMpegFile::close()
}
if( d->formatContext ) {
- ::av_close_input_file( d->formatContext );
+ ::avformat_close_input( &d->formatContext );
d->formatContext = 0;
}
}
@@ -222,11 +231,7 @@ QString K3bFFMpegFile::typeComment() con
return i18n("Windows Media v1");
case CODEC_ID_WMAV2:
return i18n("Windows Media v2");
-#if LIBAVCODEC_VERSION_MAJOR < 52
- case CODEC_ID_MP3LAME:
-#else
case CODEC_ID_MP3:
-#endif
return i18n("MPEG 1 Layer III");
case CODEC_ID_AAC:
return i18n("Advanced Audio Coding (AAC)");
@@ -329,14 +334,14 @@ int K3bFFMpegFile::fillOutputBuffer()
d->outputBufferPos = d->alignedOutputBuffer;
d->outputBufferSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
-#if LIBAVCODEC_VERSION_MAJOR < 52
- int len = ::avcodec_decode_audio(
-#else
- #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
+#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
int len = ::avcodec_decode_audio3(
- #else
+#else
+# ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2
int len = ::avcodec_decode_audio2(
- #endif
+# else
+ int len = ::avcodec_decode_audio(
+# endif
#endif
#ifdef FFMPEG_BUILD_PRE_4629
@@ -346,7 +351,7 @@ int K3bFFMpegFile::fillOutputBuffer()
#endif
(short*)d->alignedOutputBuffer,
&d->outputBufferSize,
-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
+#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
&d->packet );
#else
d->packetData, d->packetSize );
0331-Introduce-a-macro-for-referencing-the-ffmpeg-codec.patch:
k3bffmpegwrapper.cpp | 41 +++++++++--------------------------------
1 file changed, 9 insertions(+), 32 deletions(-)
--- NEW FILE 0331-Introduce-a-macro-for-referencing-the-ffmpeg-codec.patch ---
From d27648fc8946735913176dff0c497c806f63dc8a Mon Sep 17 00:00:00 2001
From: Alex Merry <kde(a)randomguy3.me.uk>
Date: Fri, 24 Aug 2012 03:07:15 +0100
Subject: [PATCH 331/351] Introduce a macro for referencing the ffmpeg codec
This simplifies the code somewhat.
REVIEW: 106153
---
plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp | 40 +++++++----------------------
1 file changed, 9 insertions(+), 31 deletions(-)
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
index 0a8fabc..a5ef087 100644
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -39,7 +39,9 @@ extern "C" {
#if LIBAVFORMAT_BUILD < 4629
-#define FFMPEG_BUILD_PRE_4629
+#define FFMPEG_CODEC(s) (&s->codec)
+#else
+#define FFMPEG_CODEC(s) (s->codec)
#endif
#ifndef HAVE_FFMPEG_AVFORMAT_OPEN_INPUT
@@ -126,11 +128,7 @@ bool K3bFFMpegFile::open()
}
// urgh... ugly
-#ifdef FFMPEG_BUILD_PRE_4629
- ::AVCodecContext* codecContext = &d->formatContext->streams[0]->codec;
-#else
- ::AVCodecContext* codecContext = d->formatContext->streams[0]->codec;
-#endif
+ ::AVCodecContext* codecContext = FFMPEG_CODEC(d->formatContext->streams[0]);
if( codecContext->codec_type != AVMEDIA_TYPE_AUDIO)
{
kDebug() << "(K3bFFMpegFile) not a simple audio stream: "
<< m_filename;
@@ -173,11 +171,7 @@ void K3bFFMpegFile::close()
d->packetData = 0;
if( d->codec ) {
-#ifdef FFMPEG_BUILD_PRE_4629
- ::avcodec_close( &d->formatContext->streams[0]->codec );
-#else
- ::avcodec_close( d->formatContext->streams[0]->codec );
-#endif
+ ::avcodec_close( FFMPEG_CODEC(d->formatContext->streams[0]) );
d->codec = 0;
}
@@ -196,31 +190,19 @@ K3b::Msf K3bFFMpegFile::length() const
int K3bFFMpegFile::sampleRate() const
{
-#ifdef FFMPEG_BUILD_PRE_4629
- return d->formatContext->streams[0]->codec.sample_rate;
-#else
- return d->formatContext->streams[0]->codec->sample_rate;
-#endif
+ return FFMPEG_CODEC(d->formatContext->streams[0])->sample_rate;
}
int K3bFFMpegFile::channels() const
{
-#ifdef FFMPEG_BUILD_PRE_4629
- return d->formatContext->streams[0]->codec.channels;
-#else
- return d->formatContext->streams[0]->codec->channels;
-#endif
+ return FFMPEG_CODEC(d->formatContext->streams[0])->channels;
}
int K3bFFMpegFile::type() const
{
-#ifdef FFMPEG_BUILD_PRE_4629
- return d->formatContext->streams[0]->codec.codec_id;
-#else
- return d->formatContext->streams[0]->codec->codec_id;
-#endif
+ return FFMPEG_CODEC(d->formatContext->streams[0])->codec_id;
}
@@ -344,11 +326,7 @@ int K3bFFMpegFile::fillOutputBuffer()
# endif
#endif
-#ifdef FFMPEG_BUILD_PRE_4629
- &d->formatContext->streams[0]->codec,
-#else
- d->formatContext->streams[0]->codec,
-#endif
+ FFMPEG_CODEC(d->formatContext->streams[0]),
(short*)d->alignedOutputBuffer,
&d->outputBufferSize,
#ifdef HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3
--
1.8.4.2
k3b-ffmpeg-review-113295-1.patch:
CMakeLists.txt | 9 ++++++++-
plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp | 18 ++++++++++++++++++
plugins/decoder/ffmpeg/k3bffmpegwrapper.h | 1 +
3 files changed, 27 insertions(+), 1 deletion(-)
--- NEW FILE k3b-ffmpeg-review-113295-1.patch ---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca1531d8e601e423002f6ffa490f2d5bb8dbf5d8..eaf116d14a7de5b330db3823e93477653319177c
100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,12 +142,19 @@ if(K3B_BUILD_FFMPEG_DECODER_PLUGIN)
int main() { enum AVMediaType t = AVMEDIA_TYPE_UNKNOWN; return 0; }
" HAVE_FFMPEG_AVMEDIA_TYPE)
check_c_source_compiles("
+ #define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
#ifdef NEWFFMPEGAVCODECPATH
#include <libavcodec/avcodec.h>
#else
#include <ffmpeg/avcodec.h>
#endif
- int main() { enum CodecID t = CODEC_ID_MP3; return 0; }
+ int main() {
+ #if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
+ # Not needed here. AV_CODEC_ID_MP3 exists. return 0;
+ #else
+ enum CodecID t = CODEC_ID_MP3; return 0;
+ #endif
+ }
" HAVE_FFMPEG_CODEC_MP3)
cmake_pop_check_state()
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.h
b/plugins/decoder/ffmpeg/k3bffmpegwrapper.h
index 1ec36b6e465a08f7fe42c80b926e98683be75a5e..88c44f3ec484be4ce0aaa719e219e4a61ec4ac25
100644
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.h
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.h
@@ -18,6 +18,7 @@
#include "k3bmsf.h"
+#define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
/**
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
index a5ef087a5ac3a2dc8b7d385b9c3a2e16bf6622bb..5e97cbd7e8b0790f355e6d8b29b8dc55ea099617
100644
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -67,6 +67,13 @@ extern "C" {
# define CODEC_ID_MP3 CODEC_ID_MP3LAME
#endif
+// Has been deprecated for ages. Now removed. For now do what ffmpeg does
+//
http://ffmpeg.org/pipermail/ffmpeg-cvslog/2012-August/053785.html
+// 192000 = 1 second of 48khz 32bit audio
+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000
+#endif
+
K3bFFMpegWrapper* K3bFFMpegWrapper::s_instance = 0;
@@ -209,6 +216,16 @@ int K3bFFMpegFile::type() const
QString K3bFFMpegFile::typeComment() const
{
switch( type() ) {
+#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
+ case AV_CODEC_ID_WMAV1:
+ return i18n("Windows Media v1");
+ case AV_CODEC_ID_WMAV2:
+ return i18n("Windows Media v2");
+ case AV_CODEC_ID_MP3:
+ return i18n("MPEG 1 Layer III");
+ case AV_CODEC_ID_AAC:
+ return i18n("Advanced Audio Coding (AAC)");
+#else
case CODEC_ID_WMAV1:
return i18n("Windows Media v1");
case CODEC_ID_WMAV2:
@@ -217,6 +234,7 @@ QString K3bFFMpegFile::typeComment() const
return i18n("MPEG 1 Layer III");
case CODEC_ID_AAC:
return i18n("Advanced Audio Coding (AAC)");
+#endif
default:
return QString::fromLocal8Bit( d->codec->name );
}
Index: k3b-extras-freeworld.spec
===================================================================
RCS file: /cvs/free/rpms/k3b-extras-freeworld/F-19/k3b-extras-freeworld.spec,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- k3b-extras-freeworld.spec 26 May 2013 21:47:47 -0000 1.35
+++ k3b-extras-freeworld.spec 1 Nov 2013 14:13:33 -0000 1.36
@@ -1,15 +1,19 @@
+# undefine these to disable
+%define ffmpeg_decoder 1
+%define lame_encoder 1
+%define mad_decoder 1
+
Name: k3b-extras-freeworld
Summary: Additional codec plugins for the k3b CD/DVD burning application
Epoch: 1
Version: 2.0.2
-Release: 11%{?dist}
+Release: 14%{?dist}
-Group: Applications/Archiving
License: GPLv2+
URL:
http://www.k3b.org/
Source0:
http://downloads.sourceforge.net/sourceforge/k3b/k3b-%{version}%{?pre}.ta...
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
# TODO: bugzilla/document
ExcludeArch: s390 s390x
@@ -17,85 +21,111 @@
Patch244: 0244-Fixed-compilation-with-new-FFMPEG.patch
Patch290: 0290-fix-for-newer-kde-4.7-FindFFMPEG.cmake.patch
Patch312: 0312-Fix-K3B-to-build-with-recent-FFMPEG-versions.patch
+# rebased 0330 to apply to 2.0 branch
+Patch330: 0330-CMake-checks-for-FFmpeg-API-changes.patch
+Patch331: 0331-Introduce-a-macro-for-referencing-the-ffmpeg-codec.patch
+
+#
https://git.reviewboard.kde.org/r/113295/
+# see also
http://bugs.kde.org/325486
+Patch500: k3b-ffmpeg-review-113295-1.patch
-BuildRequires: cmake
-BuildRequires: flac-devel
+BuildRequires: desktop-file-utils
BuildRequires: gettext
-BuildRequires: kdelibs4-devel
+BuildRequires: kdelibs4-devel phonon-backend-gstreamer
+%if 0%{?fedora} > 16 || 0%{?rhel} > 6
+BuildRequires: libkcddb-devel
+%else
BuildRequires: kdemultimedia-devel
-BuildRequires: libdvdread-devel
+%endif
BuildRequires: libmpcdec-devel
-BuildRequires: libmusicbrainz-devel
-BuildRequires: libsamplerate-devel
-BuildRequires: libsndfile-devel
-BuildRequires: libvorbis-devel
+BuildRequires: pkgconfig(dvdread)
+BuildRequires: pkgconfig(flac++)
+BuildRequires: pkgconfig(libmusicbrainz)
# needed by k3bsetup
-#BuildRequires: polkit-qt-devel
-BuildRequires: taglib-devel
-
-BuildRequires: ffmpeg-devel
-BuildRequires: lame-devel
-BuildRequires: libdvdread-devel
-BuildRequires: libmad-devel
-
-Requires: k3b >= %{epoch}:%{version}
+#BuildRequires: pkgconfig(polkit-qt-1)
+BuildRequires: pkgconfig(samplerate)
+BuildRequires: pkgconfig(sndfile)
+BuildRequires: pkgconfig(taglib)
+BuildRequires: pkgconfig(vorbisenc) pkgconfig(vorbisfile)
+BuildRequires: pkgconfig(taglib)
+
+%if 0%{?ffmpeg_decoder}
+BuildRequires: pkgconfig(libavcodec) pkgconfig(libavformat)
+%endif
+%if 0%{?mad_decoder}
+BuildRequires: pkgconfig(mad)
+%endif
+%if 0%{?lame_encoder}
+BuildRequires: lame-devel
+%endif
+Requires: k3b >= %{epoch}:%{version}
%description
Additional decoder/encoder plugins for k3b, a feature-rich and easy to
handle CD/DVD burning application.
-
%prep
%setup -q -n k3b-%{version}
%patch244 -p1 -b .0244
%patch290 -p1 -b .0290
%patch312 -p1 -b .0313
+%patch330 -p1 -b .0330
+%patch331 -p1 -b .0331
+%patch500 -p1 -b .ffmpeg-review-113295-1
-%build
+%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake_kde4} \
+ -DK3B_BUILD_FFMPEG_DECODER_PLUGIN:BOOL=%{?ffmpeg_decoder:ON}%{!?ffmpeg_decoder:OFF} \
+ -DK3B_BUILD_LAME_ENCODER_PLUGIN:BOOL=%{?lame_encoder:ON}%{!?lame_encoder:OFF} \
+ -DK3B_BUILD_MAD_DECODER_PLUGIN:BOOL=%{?mad_decoder:ON}%{!?mad_decoder:OFF} \
..
popd
-#make %{?_smp_mflags} -C %{_target_platform}/libk3bdevice
-#make %{?_smp_mflags} -C %{_target_platform}/libk3b
-make %{?_smp_mflags} -C %{_target_platform}/plugins/decoder/ffmpeg
-make %{?_smp_mflags} -C %{_target_platform}/plugins/decoder/mp3
-make %{?_smp_mflags} -C %{_target_platform}/plugins/encoder/lame
-
+%{?ffmpeg_decoder:make %{?_smp_mflags} -C %{_target_platform}/plugins/decoder/ffmpeg}
+%{?mad_decoder:make %{?_smp_mflags} -C %{_target_platform}/plugins/decoder/mp3}
+%{?lame_encoder:make %{?_smp_mflags} -C %{_target_platform}/plugins/encoder/lame}
%install
-rm -rf %{buildroot}
-
-make install/fast DESTDIR=%{buildroot} -C %{_target_platform}/plugins/decoder/ffmpeg
-make install/fast DESTDIR=%{buildroot} -C %{_target_platform}/plugins/decoder/mp3
-make install/fast DESTDIR=%{buildroot} -C %{_target_platform}/plugins/encoder/lame
-
-
-%clean
-rm -rf %{buildroot}
+%{?ffmpeg_decoder:make install/fast DESTDIR=%{buildroot} -C
%{_target_platform}/plugins/decoder/ffmpeg}
+%{?mad_decoder:make install/fast DESTDIR=%{buildroot} -C
%{_target_platform}/plugins/decoder/mp3}
+%{?lame_encoder:make install/fast DESTDIR=%{buildroot} -C
%{_target_platform}/plugins/encoder/lame}
%files
-%defattr(-,root,root,-)
+%if 0%{?ffmpeg_decoder}
%{_kde4_libdir}/kde4/k3bffmpegdecoder.so
+%{_kde4_datadir}/kde4/services/k3bffmpegdecoder.desktop
+%endif
+%if 0%{?lame_encoder}
%{_kde4_libdir}/kde4/k3blameencoder.so
-%{_kde4_libdir}/kde4/k3bmaddecoder.so
%{_kde4_libdir}/kde4/kcm_k3blameencoder.so
-%{_kde4_datadir}/kde4/services/k3bffmpegdecoder.desktop
%{_kde4_datadir}/kde4/services/k3blameencoder.desktop
-%{_kde4_datadir}/kde4/services/k3bmaddecoder.desktop
%{_kde4_datadir}/kde4/services/kcm_k3blameencoder.desktop
+%endif
+%if 0%{?mad_decoder}
+%{_kde4_libdir}/kde4/k3bmaddecoder.so
+%{_kde4_datadir}/kde4/services/k3bmaddecoder.desktop
+%endif
%changelog
+* Fri Nov 01 2013 Rex Dieter <rdieter(a)fedoraproject.org> 1:2.0.2-14
+- re-enable ffmpeg support (kde-bug#325486,kde-review#113295)
+
+* Tue Oct 01 2013 Rex Dieter <rdieter(a)fedoraproject.org> 1:2.0.2-13
+- cleanup/rebuild
+
+* Thu Aug 15 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 1:2.0.2-12
+- Rebuilt for FFmpeg 2.0.x
+
* Sun May 26 2013 Nicolas Chauvet <kwizart(a)gmail.com> - 1:2.0.2-11
- Rebuilt for x264/FFmpeg