Date: Wed, 2 Nov 2011 18:27:15 -0600 (MDT) From: Phil Oleson <oz@nixil.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/162261: sysutils/k3b-kde4 - fails to compile with ffmpeg-devel installed. Message-ID: <201111030027.pA30RFY1077869@nixil.net> Resent-Message-ID: <201111030050.pA30oAZn082146@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 162261 >Category: ports >Synopsis: sysutils/k3b-kde4 - fails to compile with ffmpeg-devel installed. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 03 00:50:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Phil Oleson >Release: FreeBSD 9.0-RC1 amd64 >Organization: N/A >Environment: System: FreeBSD home.nixil.net 9.0-RC1 FreeBSD 9.0-RC1 #1: Tue Oct 25 16:53:08 MDT 2011 root@home.nixil.net:/usr/obj/usr/src/sys/home amd64 >Description: Compilation of k3b-kde4 fails to build when ffmpeg-devel is installed.. >How-To-Repeat: build with ffmpeg-devel installed. >Fix: patch adapted from http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-cdr/k3b/files/k3b-2.0.2-ffmpeg.patch?revision=1.1 Author: Michal Malek <michalm [at] jabster.pl> --- patch-plugins__decoder__ffmpeg__k3bffmpegwrapper.cpp begins here --- --- ./plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp.orig +++ ./plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp @@ -109,7 +109,13 @@ bool K3bFFMpegFile::open() #else ::AVCodecContext* codecContext = d->formatContext->streams[0]->codec; #endif - if( codecContext->codec_type != CODEC_TYPE_AUDIO ) { + if( codecContext->codec_type != +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) + AVMEDIA_TYPE_AUDIO) +#else + CODEC_TYPE_AUDIO) +#endif + { kDebug() << "(K3bFFMpegFile) not a simple audio stream: " << m_filename; return false; } @@ -225,8 +231,11 @@ QString K3bFFMpegFile::typeComment() const QString K3bFFMpegFile::title() const { // FIXME: is this UTF8 or something?? - if( d->formatContext->title[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->title ); + AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "TITLE", NULL, 0 ); + if( ade == NULL ) + return QString(); + if( ade->value != '\0' ) + return QString::fromLocal8Bit( ade->value ); else return QString(); } @@ -235,8 +244,11 @@ QString K3bFFMpegFile::title() const QString K3bFFMpegFile::author() const { // FIXME: is this UTF8 or something?? - if( d->formatContext->author[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->author ); + AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "ARTIST", NULL, 0 ); + if( ade == NULL ) + return QString(); + if( ade->value != '\0' ) + return QString::fromLocal8Bit( ade->value ); else return QString(); } @@ -245,8 +257,11 @@ QString K3bFFMpegFile::author() const QString K3bFFMpegFile::comment() const { // FIXME: is this UTF8 or something?? - if( d->formatContext->comment[0] != '\0' ) - return QString::fromLocal8Bit( d->formatContext->comment ); + AVDictionaryEntry *ade = av_dict_get( d->formatContext->metadata, "COMMENT", NULL, 0 ); + if( ade == NULL ) + return QString(); + if( ade->value != '\0' ) + return QString::fromLocal8Bit( ade->value ); else return QString(); } @@ -309,8 +324,13 @@ int K3bFFMpegFile::fillOutputBuffer() #if LIBAVCODEC_VERSION_MAJOR < 52 int len = ::avcodec_decode_audio( #else + #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) + int len = ::avcodec_decode_audio3( + #else int len = ::avcodec_decode_audio2( + #endif #endif + #ifdef FFMPEG_BUILD_PRE_4629 &d->formatContext->streams[0]->codec, #else @@ -318,7 +338,11 @@ int K3bFFMpegFile::fillOutputBuffer() #endif (short*)d->alignedOutputBuffer, &d->outputBufferSize, +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0) + &d->packet ); +#else d->packetData, d->packetSize ); +#endif if( d->packetSize <= 0 || len < 0 ) ::av_free_packet( &d->packet ); --- patch-plugins__decoder__ffmpeg__k3bffmpegwrapper.cpp ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111030027.pA30RFY1077869>