You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1.3 KiB

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