Gentoo Archives: gentoo-commits

From: "Tim Harder (radhermit)" <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-emulation/vbam/files: vbam-1.8.0.1228-ffmpeg2.patch
Date: Sun, 04 May 2014 16:28:50
Message-Id: 20140504162846.4CD822004E@flycatcher.gentoo.org
1 radhermit 14/05/04 16:28:46
2
3 Added: vbam-1.8.0.1228-ffmpeg2.patch
4 Log:
5 Fix build with =media-video/ffmpeg-2* (bug #476496, patch by aballier).
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
8
9 Revision Changes Path
10 1.1 games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-emulation/vbam/files/vbam-1.8.0.1228-ffmpeg2.patch?rev=1.1&content-type=text/plain
14
15 Index: vbam-1.8.0.1228-ffmpeg2.patch
16 ===================================================================
17 --- vbam-1.8.0.1228/src/common/ffmpeg.cpp
18 +++ vbam-1.8.0.1228/src/common/ffmpeg.cpp
19 @@ -178,17 +178,31 @@ MediaRet MediaRecorder::setup_video_stre
20 // make sure RGB is supported (mostly not)
21 if(codec->pix_fmts) {
22 const enum PixelFormat *p;
23 +#if LIBAVCODEC_VERSION_MAJOR < 55
24 int64_t mask = 0;
25 +#endif
26 for(p = codec->pix_fmts; *p != -1; p++) {
27 // may get complaints about 1LL; thus the cast
28 +#if LIBAVCODEC_VERSION_MAJOR < 55
29 mask |= ((int64_t)1) << *p;
30 +#endif
31 if(*p == pixfmt)
32 break;
33 }
34 if(*p == -1) {
35 // if not supported, use a converter to the next best format
36 // this is swscale, the converter used by the output demo
37 +#if LIBAVCODEC_VERSION_MAJOR < 55
38 enum PixelFormat dp = (PixelFormat)avcodec_find_best_pix_fmt(mask, pixfmt, 0, NULL);
39 +#else
40 +#if LIBAVCODEC_VERSION_MICRO >= 100
41 +// FFmpeg
42 + enum AVPixelFormat dp = avcodec_find_best_pix_fmt_of_list(codec->pix_fmts, pixfmt, 0, NULL);
43 +#else
44 +// Libav
45 + enum AVPixelFormat dp = avcodec_find_best_pix_fmt2(codec->pix_fmts, pixfmt, 0, NULL);
46 +#endif
47 +#endif
48 if(dp == -1)
49 dp = codec->pix_fmts[0];
50 if(!(convpic = avcodec_alloc_frame()) ||