Files
nixpkgs/pkgs/by-name/me/megacmd/fix-ffmpeg.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

30 lines
961 B
Diff

--- 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