Skip to content

Commit e503ac5

Browse files
committed
fix: libavcodec version check for AV_CODEC_FLAG_GLOBAL_HEADER
1 parent f5ba3f5 commit e503ac5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/videoio/src/cap_ffmpeg_impl.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,9 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
19491949
// some formats want stream headers to be separate
19501950
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
19511951
{
1952-
#if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0)
1952+
// flags were renamed: https://github.com/libav/libav/commit/7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615
1953+
#if LIBAVCODEC_BUILD >= (LIBAVCODEC_VERSION_MICRO >= 100 \
1954+
? CALC_FFMPEG_VERSION(56, 60, 100) : CALC_FFMPEG_VERSION(56, 35, 0))
19531955
c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
19541956
#else
19551957
c->flags |= CODEC_FLAG_GLOBAL_HEADER;

0 commit comments

Comments
 (0)