Lines 1-34
Link Here
|
1 |
--- src/common/ffmpeg.cpp.orig 2014-04-29 21:21:05.929639513 -0700 |
|
|
2 |
+++ src/common/ffmpeg.cpp 2014-04-29 21:26:22.513617805 -0700 |
3 |
@@ -178,17 +178,31 @@ |
4 |
// make sure RGB is supported (mostly not) |
5 |
if(codec->pix_fmts) { |
6 |
const enum PixelFormat *p; |
7 |
+#if LIBAVCODEC_VERSION_MAJOR < 55 |
8 |
int64_t mask = 0; |
9 |
+#endif |
10 |
for(p = codec->pix_fmts; *p != -1; p++) { |
11 |
// may get complaints about 1LL; thus the cast |
12 |
+#if LIBAVCODEC_VERSION_MAJOR < 55 |
13 |
mask |= ((int64_t)1) << *p; |
14 |
+#endif |
15 |
if(*p == pixfmt) |
16 |
break; |
17 |
} |
18 |
if(*p == -1) { |
19 |
// if not supported, use a converter to the next best format |
20 |
// this is swscale, the converter used by the output demo |
21 |
+#if LIBAVCODEC_VERSION_MAJOR < 55 |
22 |
enum PixelFormat dp = (PixelFormat)avcodec_find_best_pix_fmt(mask, pixfmt, 0, NULL); |
23 |
+#else |
24 |
+#if LIBAVCODEC_VERSION_MICRO >= 100 |
25 |
+// FFmpeg |
26 |
+ enum AVPixelFormat dp = avcodec_find_best_pix_fmt_of_list(codec->pix_fmts, pixfmt, 0, NULL); |
27 |
+#else |
28 |
+// libav |
29 |
+ enum AVPixelFormat dp = avcodec_find_best_pix_fmt2(codec->pix_fmts, pixfmt, 0, NULL); |
30 |
+#endif |
31 |
+#endif |
32 |
if(dp == -1) |
33 |
dp = codec->pix_fmts[0]; |
34 |
if(!(convpic = avcodec_alloc_frame()) || |