--- plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.ffmpeg 2011-01-15 21:47:29.000000000 +0100 +++ plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp 2011-06-24 16:53:55.000000000 +0200 @@ -109,7 +109,7 @@ #else ::AVCodecContext* codecContext = d->formatContext->streams[0]->codec; #endif - if( codecContext->codec_type != CODEC_TYPE_AUDIO ) { + if( codecContext->codec_type != AVMEDIA_TYPE_AUDIO ) { kDebug() << "(K3bFFMpegFile) not a simple audio stream: " << m_filename; return false; } @@ -224,9 +224,11 @@ QString K3bFFMpegFile::title() const { + AVMetadataTag *title; + title = av_metadata_get(d->formatContext->metadata, "title", NULL, 0); // FIXME: is this UTF8 or something?? - if( d->formatContext->title[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->title ); + if( title ) + return QString::fromLocal8Bit( title->value ); else return QString(); } @@ -234,9 +236,11 @@ QString K3bFFMpegFile::author() const { + AVMetadataTag *author; + author = av_metadata_get(d->formatContext->metadata, "author", NULL, 0); // FIXME: is this UTF8 or something?? - if( d->formatContext->author[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->author ); + if( author ) + return QString::fromLocal8Bit( author->value ); else return QString(); } @@ -244,9 +248,11 @@ QString K3bFFMpegFile::comment() const { + AVMetadataTag *comment; + comment = av_metadata_get(d->formatContext->metadata, "comment", NULL, 0); // FIXME: is this UTF8 or something?? - if( d->formatContext->comment[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->comment ); + if( comment ) + return QString::fromLocal8Bit( comment->value ); else return QString(); } @@ -308,8 +314,14 @@ #if LIBAVCODEC_VERSION_MAJOR < 52 int len = ::avcodec_decode_audio( -#else +#elif LIBAVCODEC_VERSION_MAJOR == 52 int len = ::avcodec_decode_audio2( +#else + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = d->packetData; + avpkt.size = d->packetSize; + int len = ::avcodec_decode_audio3( #endif #ifdef FFMPEG_BUILD_PRE_4629 &d->formatContext->streams[0]->codec, @@ -318,7 +330,11 @@ #endif (short*)d->alignedOutputBuffer, &d->outputBufferSize, +#if LIBAVCODEC_VERSION_MAJOR < 53 d->packetData, d->packetSize ); +#else + &avpkt); +#endif if( d->packetSize <= 0 || len < 0 ) ::av_free_packet( &d->packet );