summaryrefslogtreecommitdiff
path: root/sci-electronics/gazebo/files/ffmpeg6.patch
blob: 932d1e31c9d1cab954fd57be5bd54227c0a25cae (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
39
40
Index: gazebo-11.12.0/gazebo/common/AudioDecoder.cc
===================================================================
--- gazebo-11.12.0.orig/gazebo/common/AudioDecoder.cc
+++ gazebo-11.12.0/gazebo/common/AudioDecoder.cc
@@ -364,6 +364,7 @@ bool AudioDecoder::SetFile(const std::st
     return false;
   }
 
+#if LIBAVCODEC_VERSION_MAJOR < 60
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
   if (this->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
     this->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED;
@@ -371,6 +372,7 @@ bool AudioDecoder::SetFile(const std::st
   if (this->codec->capabilities & CODEC_CAP_TRUNCATED)
     this->codecCtx->flags |= CODEC_FLAG_TRUNCATED;
 #endif
+#endif
 
   // Open codec
   if (avcodec_open2(this->codecCtx, this->codec, nullptr) < 0)
Index: gazebo-11.12.0/gazebo/common/Video.cc
===================================================================
--- gazebo-11.12.0.orig/gazebo/common/Video.cc
+++ gazebo-11.12.0/gazebo/common/Video.cc
@@ -214,6 +214,7 @@ bool Video::Load(const std::string &_fil
     return false;
   }
 
+#if LIBAVCODEC_VERSION_MAJOR < 60
   // Inform the codec that we can handle truncated bitstreams -- i.e.,
   // bitstreams where frame boundaries can fall in the middle of packets
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
@@ -223,6 +224,7 @@ bool Video::Load(const std::string &_fil
   if (codec->capabilities & CODEC_CAP_TRUNCATED)
     this->codecCtx->flags |= CODEC_FLAG_TRUNCATED;
 #endif
+#endif
 
   // Open codec
   if (avcodec_open2(this->codecCtx, codec, nullptr) < 0)