Files
nixpkgs/pkgs/by-name/me/megacmd/fix-ffmpeg.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
961 B
Diff
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
--- a/sdk/src/gfx/freeimage.cpp
+++ b/sdk/src/gfx/freeimage.cpp
@@ -216,11 +216,13 @@ bool GfxProviderFreeImage::readbitmapFreeimage(const LocalPath& imagePath, int s
#ifdef HAVE_FFMPEG
+#if LIBAVCODEC_VERSION_MAJOR < 60
#ifdef AV_CODEC_CAP_TRUNCATED
#define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
#else
#define CAP_TRUNCATED CODEC_CAP_TRUNCATED
#endif
+#endif
const char *GfxProviderFreeImage::supportedformatsFfmpeg()
{
@@ -323,10 +325,12 @@ bool GfxProviderFreeImage::readbitmapFfmpeg(const LocalPath& imagePath, int size
// Force seeking to key frames
formatContext->seek2any = false;
+#if LIBAVCODEC_VERSION_MAJOR < 60
if (decoder->capabilities & CAP_TRUNCATED)
{
codecContext->flags |= CAP_TRUNCATED;
}
+#endif
AVPixelFormat sourcePixelFormat = static_cast<AVPixelFormat>(codecParm->format);
AVPixelFormat targetPixelFormat = AV_PIX_FMT_BGR24; //raw data expected by freeimage is in this format