summarylogtreecommitdiffstats
path: root/ffmpeg.patch
blob: d9ebac2df7d3e456da2343123d8e467beefefa5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- freeimage.cpp.old	2023-10-10 17:44:29.522212542 -0300
+++ freeimage.cpp	2023-10-10 17:47:32.768202551 -0300
@@ -209,11 +209,7 @@
 
 #ifdef HAVE_FFMPEG
 
-#ifdef AV_CODEC_CAP_TRUNCATED
-#define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
-#else
-#define CAP_TRUNCATED CODEC_CAP_TRUNCATED
-#endif
+#define CAP_TRUNCATED 0
 
 const char *GfxProviderFreeImage::supportedformatsFfmpeg()
 {
@@ -313,7 +309,7 @@
 
     // Find decoder for video stream
     AVCodecID codecId = codecParm->codec_id;
-    auto decoder = avcodec_find_decoder(codecId);
+    const AVCodec* decoder = avcodec_find_decoder(codecId);
     if (!decoder)
     {
         LOG_warn << "Codec not found: " << codecId;
@@ -330,10 +326,6 @@
 
     // Force seeking to key frames
     formatContext->seek2any = false;
-    if (decoder->capabilities & CAP_TRUNCATED)
-    {
-        codecContext->flags |= CAP_TRUNCATED;
-    }
 
     AVPixelFormat sourcePixelFormat = static_cast<AVPixelFormat>(codecParm->format);
     AVPixelFormat targetPixelFormat = AV_PIX_FMT_BGR24; //raw data expected by freeimage is in this format