blob: f42c30d922245a1668ad6c040d4a777143ed4bd8 (
plain)
--- a/src/MEGASync/mega/src/gfx/freeimage.cpp 2024-02-05 12:31:08.907475460 +0900
+++ b/src/MEGASync/mega/src/gfx/freeimage.cpp 2024-02-05 13:38:52.356174823 +0900
@@ -209,11 +209,13 @@
#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()
{
@@ -313,7 +315,7 @@
// Find decoder for video stream
AVCodecID codecId = codecParm->codec_id;
- AVCodec* decoder = avcodec_find_decoder(codecId);
+ auto decoder = avcodec_find_decoder(codecId);
if (!decoder)
{
LOG_warn << "Codec not found: " << codecId;
@@ -330,11 +332,13 @@
// Force seeking to key frames
formatContext->seek2any = false;
- videoStream->skip_to_keyframe = true;
+ //videoStream->skip_to_keyframe = true;
+ #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
|