summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-14 21:10:38 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-10-14 21:10:38 +0000
commit4b97664c5da5b58c697a693875139b2f0db45f47 (patch)
tree22c14284af297157791e8687c940d851eecd5989
parent11564961f93c39df53c3938c0ecf9e0eb26b3b72 (diff)
downloadk3b-4b97664c5da5b58c697a693875139b2f0db45f47.tar.gz
k3b-4b97664c5da5b58c697a693875139b2f0db45f47.zip
Fix k3b FTBFS under oneiric
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1258926 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp35
-rw-r--r--src/Makefile.am2
-rw-r--r--src/k3bsystemproblemdialog.cpp4
3 files changed, 37 insertions, 4 deletions
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
index 898c47d..e7edd6e 100644
--- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
+++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
@@ -31,6 +31,11 @@ extern "C" {
#define FFMPEG_BUILD_PRE_4629
#endif
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0)
+#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
+#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
+#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE
+#endif
K3bFFMpegWrapper* K3bFFMpegWrapper::s_instance = 0;
@@ -95,7 +100,7 @@ bool K3bFFMpegFile::open()
#else
AVCodecContext* codecContext = d->formatContext->streams[0]->codec;
#endif
- if( codecContext->codec_type != CODEC_TYPE_AUDIO ) {
+ if( codecContext->codec_type != AVMEDIA_TYPE_AUDIO ) {
kdDebug() << "(K3bFFMpegFile) not a simple audio stream: " << m_filename << endl;
return false;
}
@@ -207,8 +212,14 @@ TQString K3bFFMpegFile::typeComment() const
TQString K3bFFMpegFile::title() const
{
// FIXME: is this UTF8 or something??
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->title[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->title );
+#else
+ AVDictionaryEntry *entry = av_dict_get(d->formatContext->metadata, "title", NULL, 0);
+ if( entry->value[0] != '\0' )
+ return TQString::fromLocal8Bit( entry->value );
+#endif
else
return TQString();
}
@@ -217,8 +228,14 @@ TQString K3bFFMpegFile::title() const
TQString K3bFFMpegFile::author() const
{
// FIXME: is this UTF8 or something??
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->author[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->author );
+#else
+ AVDictionaryEntry *entry = av_dict_get(d->formatContext->metadata, "author", NULL, 0);
+ if( entry->value[0] != '\0' )
+ return TQString::fromLocal8Bit( entry->value );
+#endif
else
return TQString();
}
@@ -227,8 +244,14 @@ TQString K3bFFMpegFile::author() const
TQString K3bFFMpegFile::comment() const
{
// FIXME: is this UTF8 or something??
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->comment[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->comment );
+#else
+ AVDictionaryEntry *entry = av_dict_get(d->formatContext->metadata, "comment", NULL, 0);
+ if( entry->value[0] != '\0' )
+ return TQString::fromLocal8Bit( entry->value );
+#endif
else
return TQString();
}
@@ -287,6 +310,15 @@ int K3bFFMpegFile::fillOutputBuffer()
d->outputBufferPos = d->outputBuffer;
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
+ AVPacket avp;
+ av_init_packet( &avp );
+ avp.data = d->packetData;
+ avp.size = d->packetSize;
+int len = avcodec_decode_audio3( d->formatContext->streams[0]->codec,
+ (short*)d->outputBuffer, &d->outputBufferSize,
+ &avp );
+#else
#ifdef FFMPEG_BUILD_PRE_4629
int len = avcodec_decode_audio2( &d->formatContext->streams[0]->codec,
#else
@@ -294,6 +326,7 @@ int K3bFFMpegFile::fillOutputBuffer()
#endif
(short*)d->outputBuffer, &d->outputBufferSize,
d->packetData, d->packetSize );
+#endif
d->packetSize -= len;
d->packetData += len;
diff --git a/src/Makefile.am b/src/Makefile.am
index 81aa9b7..37c0c67 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,7 @@ k3b_SOURCES = k3bwelcomewidget.cpp k3bapplication.cpp k3bdiroperator.cpp \
k3b_LDADD = ./option/liboption.la ./rip/librip.la \
./projects/libprojects.la ../libk3bdevice/libk3bdevice.la \
../libk3b/libk3b.la ./misc/libmisc.la ./fastscale/libfastscale.la \
- -lkio -lkparts $(CAM_LIB) $(MUSICBRAINZ_LIBS)
+ -lkdefx -lkio -lkparts $(CAM_LIB) $(MUSICBRAINZ_LIBS)
SUBDIRS = option misc rip projects fastscale pics icons konqi mimetypes sounds
diff --git a/src/k3bsystemproblemdialog.cpp b/src/k3bsystemproblemdialog.cpp
index 75a9f58..9c39ba3 100644
--- a/src/k3bsystemproblemdialog.cpp
+++ b/src/k3bsystemproblemdialog.cpp
@@ -519,8 +519,8 @@ void K3bSystemProblemDialog::checkSystem( TQWidget* parent,
"include Mp3 support for legal reasons."),
i18n("To enable Mp3 support, please install the MAD Mp3 decoding library as well as the "
"K3b MAD Mp3 decoder plugin (the latter may already be installed but not functional "
- "due to the missing libmad). Some distributions allow installation of Mp3 support "
- "via an online update tool (i.e. SuSE's YOU)."),
+ "due to the missing libmad). To get Mp3 support, please install libk3b3-extracodecs"
+ "(or kubuntu-restricted-extras on Debian)."),
false ) );
}
*/