Open Vascom opened 1 year ago
This patch solve the problem.
--- src/MEGASync/mega/src/gfx/freeimage.cpp.orig
+++ src/MEGASync/mega/src/gfx/freeimage.cpp
@@ -209,11 +209,13 @@ bool GfxProviderFreeImage::readbitmapFre
#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()
{
@@ -331,10 +333,12 @@ bool GfxProviderFreeImage::readbitmapFfm
// Force seeking to key frames
formatContext->seek2any = false;
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
Hi
can you summit a PR for better track?
greetings
I am having this issue aswell, and the patch solves the compilation issues.
This patch solve the problem.
--- src/MEGASync/mega/src/gfx/freeimage.cpp.orig +++ src/MEGASync/mega/src/gfx/freeimage.cpp @@ -209,11 +209,13 @@ bool GfxProviderFreeImage::readbitmapFre #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() { @@ -331,10 +333,12 @@ bool GfxProviderFreeImage::readbitmapFfm // Force seeking to key frames formatContext->seek2any = false; 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
This patch (with a little tweaking) also fixed compilation on Gentoo.
FFMpeg removed AV_CODEC_CAP_TRUNCATED and CODEC_CAP_TRUNCATED definitions and now I can't build MegaSync with this error:
Please help me fix it.
Commit at ffmpeg in that removed definitions: https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/3ceffe783965767e62d59e8e68ecd265c98460ec