Skip to content

Commit d6024ce

Browse files
costashatzscpeters
authored andcommitted
Fix for ffmpeg v6 (#497)
Signed-off-by: Konstantinos Chatzilygeroudis <[email protected]>
1 parent a363f8e commit d6024ce

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

av/src/AudioDecoder.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,10 @@ bool AudioDecoder::SetFile(const std::string &_filename)
345345
}
346346

347347
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
348+
#if LIBAVCODEC_VERSION_MAJOR < 60
348349
if (this->data->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
349350
this->data->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED;
351+
#endif
350352
#else
351353
if (this->data->codec->capabilities & CODEC_CAP_TRUNCATED)
352354
this->data->codecCtx->flags |= CODEC_FLAG_TRUNCATED;

av/src/Video.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ bool Video::Load(const std::string &_filename)
182182
// Inform the codec that we can handle truncated bitstreams -- i.e.,
183183
// bitstreams where frame boundaries can fall in the middle of packets
184184
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100)
185+
#if LIBAVCODEC_VERSION_MAJOR < 60
185186
if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
186187
this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED;
188+
#endif
187189
#else
188190
if (codec->capabilities & CODEC_CAP_TRUNCATED)
189191
this->dataPtr->codecCtx->flags |= CODEC_FLAG_TRUNCATED;

0 commit comments

Comments
 (0)