summarylogtreecommitdiffstats
path: root/ffmpeg.patch
blob: 9a1af1458e29fe9b079dd79f1eaf789d12689a8e (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
36
37
38
diff --git a/src/gfx/freeimage.cpp b/src/gfx/freeimage.cpp
index 2f685279a..e4b0a8c4a 100644
--- a/src/gfx/freeimage.cpp
+++ b/src/gfx/freeimage.cpp
@@ -209,12 +209,6 @@ bool GfxProviderFreeImage::readbitmapFreeimage(FileSystemAccess*, const LocalPat
 
 #ifdef HAVE_FFMPEG
 
-#ifdef AV_CODEC_CAP_TRUNCATED
-#define CAP_TRUNCATED AV_CODEC_CAP_TRUNCATED
-#else
-#define CAP_TRUNCATED CODEC_CAP_TRUNCATED
-#endif
-
 const char *GfxProviderFreeImage::supportedformatsFfmpeg()
 {
     return  ".264.265.3g2.3gp.3gpa.3gpp.3gpp2.mp3"
@@ -313,7 +307,7 @@ bool GfxProviderFreeImage::readbitmapFfmpeg(FileSystemAccess* fa, const LocalPat
 
     // Find decoder for video stream
     AVCodecID codecId = codecParm->codec_id;
-    AVCodec* decoder = avcodec_find_decoder(codecId);
+    const AVCodec* decoder = avcodec_find_decoder(codecId);
     if (!decoder)
     {
         LOG_warn << "Codec not found: " << codecId;
@@ -330,11 +324,6 @@ bool GfxProviderFreeImage::readbitmapFfmpeg(FileSystemAccess* fa, const LocalPat
 
     // Force seeking to key frames
     formatContext->seek2any = false;
-    videoStream->skip_to_keyframe = true;
-    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