From d6febb83a8db4ba2cdc8b0d97276eb8b5454abcb Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Sun, 4 May 2014 16:28:46 +0000 Subject: Fix build with =media-video/ffmpeg-2* (bug #476496, patch by aballier). (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3) --- games-emulation/vbam/ChangeLog | 6 +++- .../vbam/files/vbam-1.8.0.1228-ffmpeg2.patch | 34 ++++++++++++++++++++++ games-emulation/vbam/vbam-1.8.0.1228.ebuild | 3 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch diff --git a/games-emulation/vbam/ChangeLog b/games-emulation/vbam/ChangeLog index 414334ca2b2d..24f2a1bd237f 100644 --- a/games-emulation/vbam/ChangeLog +++ b/games-emulation/vbam/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-emulation/vbam # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/vbam/ChangeLog,v 1.22 2014/02/05 09:57:45 radhermit Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-emulation/vbam/ChangeLog,v 1.23 2014/05/04 16:28:45 radhermit Exp $ + + 04 May 2014; Tim Harder vbam-1.8.0.1228.ebuild, + +files/vbam-1.8.0.1228-ffmpeg2.patch: + Fix build with =media-video/ffmpeg-2* (bug #476496, patch by aballier). *vbam-1.8.0.1228 (05 Feb 2014) diff --git a/games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch b/games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch new file mode 100644 index 000000000000..f2f9085f4a7f --- /dev/null +++ b/games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch @@ -0,0 +1,34 @@ +--- vbam-1.8.0.1228/src/common/ffmpeg.cpp ++++ vbam-1.8.0.1228/src/common/ffmpeg.cpp +@@ -178,17 +178,31 @@ MediaRet MediaRecorder::setup_video_stre + // make sure RGB is supported (mostly not) + if(codec->pix_fmts) { + const enum PixelFormat *p; ++#if LIBAVCODEC_VERSION_MAJOR < 55 + int64_t mask = 0; ++#endif + for(p = codec->pix_fmts; *p != -1; p++) { + // may get complaints about 1LL; thus the cast ++#if LIBAVCODEC_VERSION_MAJOR < 55 + mask |= ((int64_t)1) << *p; ++#endif + if(*p == pixfmt) + break; + } + if(*p == -1) { + // if not supported, use a converter to the next best format + // this is swscale, the converter used by the output demo ++#if LIBAVCODEC_VERSION_MAJOR < 55 + enum PixelFormat dp = (PixelFormat)avcodec_find_best_pix_fmt(mask, pixfmt, 0, NULL); ++#else ++#if LIBAVCODEC_VERSION_MICRO >= 100 ++// FFmpeg ++ enum AVPixelFormat dp = avcodec_find_best_pix_fmt_of_list(codec->pix_fmts, pixfmt, 0, NULL); ++#else ++// Libav ++ enum AVPixelFormat dp = avcodec_find_best_pix_fmt2(codec->pix_fmts, pixfmt, 0, NULL); ++#endif ++#endif + if(dp == -1) + dp = codec->pix_fmts[0]; + if(!(convpic = avcodec_alloc_frame()) || diff --git a/games-emulation/vbam/vbam-1.8.0.1228.ebuild b/games-emulation/vbam/vbam-1.8.0.1228.ebuild index 59779c72f2d0..b72b2f2594fc 100644 --- a/games-emulation/vbam/vbam-1.8.0.1228.ebuild +++ b/games-emulation/vbam/vbam-1.8.0.1228.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/vbam/vbam-1.8.0.1228.ebuild,v 1.1 2014/02/05 09:57:45 radhermit Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-emulation/vbam/vbam-1.8.0.1228.ebuild,v 1.2 2014/05/04 16:28:45 radhermit Exp $ EAPI=5 WX_GTK_VER="3.0" @@ -44,6 +44,7 @@ DEPEND="${RDEPEND} virtual/pkgconfig" src_prepare() { + epatch "${FILESDIR}"/${P}-ffmpeg2.patch epatch "${FILESDIR}"/${P}-header.patch # fix issue with zlib-1.2.5.1 macros (bug #383179) -- cgit v1.2.3-65-gdbad