caddy: 2.9.0 -> 2.9.1 (#375655)
[NixPkgs.git] / pkgs / by-name / me / megacmd / fix-ffmpeg.patch
blob45d6e85b373c8e582fcae077ce1410e2d03e5bf3
1 --- a/sdk/src/gfx/freeimage.cpp
2 +++ b/sdk/src/gfx/freeimage.cpp
3 @@ -216,11 +216,13 @@ bool GfxProviderFreeImage::readbitmapFreeimage(const LocalPath& imagePath, int s
5 #ifdef HAVE_FFMPEG
7 +#if LIBAVCODEC_VERSION_MAJOR < 60
8 #ifdef AV_CODEC_CAP_TRUNCATED
9 #define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
10 #else
11 #define CAP_TRUNCATED CODEC_CAP_TRUNCATED
12 #endif
13 +#endif
15 const char *GfxProviderFreeImage::supportedformatsFfmpeg()
17 @@ -323,10 +325,12 @@ bool GfxProviderFreeImage::readbitmapFfmpeg(const LocalPath& imagePath, int size
19 // Force seeking to key frames
20 formatContext->seek2any = false;
21 +#if LIBAVCODEC_VERSION_MAJOR < 60
22 if (decoder->capabilities & CAP_TRUNCATED)
24 codecContext->flags |= CAP_TRUNCATED;
26 +#endif
28 AVPixelFormat sourcePixelFormat = static_cast<AVPixelFormat>(codecParm->format);
29 AVPixelFormat targetPixelFormat = AV_PIX_FMT_BGR24; //raw data expected by freeimage is in this format