Fix k3b FTBFS under oneiric

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1258926 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 11564961f9
commit 4b97664c5d

@ -31,6 +31,11 @@ extern "C" {
#define FFMPEG_BUILD_PRE_4629 #define FFMPEG_BUILD_PRE_4629
#endif #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; K3bFFMpegWrapper* K3bFFMpegWrapper::s_instance = 0;
@ -95,7 +100,7 @@ bool K3bFFMpegFile::open()
#else #else
AVCodecContext* codecContext = d->formatContext->streams[0]->codec; AVCodecContext* codecContext = d->formatContext->streams[0]->codec;
#endif #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; kdDebug() << "(K3bFFMpegFile) not a simple audio stream: " << m_filename << endl;
return false; return false;
} }
@ -207,8 +212,14 @@ TQString K3bFFMpegFile::typeComment() const
TQString K3bFFMpegFile::title() const TQString K3bFFMpegFile::title() const
{ {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->title[0] != '\0' ) if( d->formatContext->title[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->title ); 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 else
return TQString(); return TQString();
} }
@ -217,8 +228,14 @@ TQString K3bFFMpegFile::title() const
TQString K3bFFMpegFile::author() const TQString K3bFFMpegFile::author() const
{ {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->author[0] != '\0' ) if( d->formatContext->author[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->author ); 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 else
return TQString(); return TQString();
} }
@ -227,8 +244,14 @@ TQString K3bFFMpegFile::author() const
TQString K3bFFMpegFile::comment() const TQString K3bFFMpegFile::comment() const
{ {
// FIXME: is this UTF8 or something?? // FIXME: is this UTF8 or something??
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 31, 0)
if( d->formatContext->comment[0] != '\0' ) if( d->formatContext->comment[0] != '\0' )
return TQString::fromLocal8Bit( d->formatContext->comment ); 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 else
return TQString(); return TQString();
} }
@ -287,6 +310,15 @@ int K3bFFMpegFile::fillOutputBuffer()
d->outputBufferPos = d->outputBuffer; 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 #ifdef FFMPEG_BUILD_PRE_4629
int len = avcodec_decode_audio2( &d->formatContext->streams[0]->codec, int len = avcodec_decode_audio2( &d->formatContext->streams[0]->codec,
#else #else
@ -294,6 +326,7 @@ int K3bFFMpegFile::fillOutputBuffer()
#endif #endif
(short*)d->outputBuffer, &d->outputBufferSize, (short*)d->outputBuffer, &d->outputBufferSize,
d->packetData, d->packetSize ); d->packetData, d->packetSize );
#endif
d->packetSize -= len; d->packetSize -= len;
d->packetData += len; d->packetData += len;

@ -28,7 +28,7 @@ k3b_SOURCES = k3bwelcomewidget.cpp k3bapplication.cpp k3bdiroperator.cpp \
k3b_LDADD = ./option/liboption.la ./rip/librip.la \ k3b_LDADD = ./option/liboption.la ./rip/librip.la \
./projects/libprojects.la ../libk3bdevice/libk3bdevice.la \ ./projects/libprojects.la ../libk3bdevice/libk3bdevice.la \
../libk3b/libk3b.la ./misc/libmisc.la ./fastscale/libfastscale.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 SUBDIRS = option misc rip projects fastscale pics icons konqi mimetypes sounds

@ -519,8 +519,8 @@ void K3bSystemProblemDialog::checkSystem( TQWidget* parent,
"include Mp3 support for legal reasons."), "include Mp3 support for legal reasons."),
i18n("To enable Mp3 support, please install the MAD Mp3 decoding library as well as the " 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 " "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 " "due to the missing libmad). To get Mp3 support, please install libk3b3-extracodecs"
"via an online update tool (i.e. SuSE's YOU)."), "(or kubuntu-restricted-extras on Debian)."),
false ) ); false ) );
} }
*/ */

Loading…
Cancel
Save