Skip to content

Commit

Permalink
fix: libavcodec version check for AVDISCARD_NONINTRA
Browse files Browse the repository at this point in the history
 - AVDISCARD_NONINTRA flag is supported only for FFMPEG libraries pack
  • Loading branch information
VadimLevin committed Aug 24, 2020
1 parent e503ac5 commit f7e524c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/videoio/src/cap_ffmpeg_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,10 @@ bool CvCapture_FFMPEG::open( const char* _filename )
enc->skip_frame = AVDISCARD_DEFAULT;
else if (strcmp(avdiscard_entry->value, "none") == 0)
enc->skip_frame = AVDISCARD_NONE;
#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54, 59, 100)
// NONINTRA flag was introduced with version bump at revision:
// https://github.com/FFmpeg/FFmpeg/commit/b152152df3b778d0a86dcda5d4f5d065b4175a7b
// This key is supported only for FFMPEG version
#if LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(55, 67, 100)
else if (strcmp(avdiscard_entry->value, "nonintra") == 0)
enc->skip_frame = AVDISCARD_NONINTRA;
#endif
Expand Down

0 comments on commit f7e524c

Please sign in to comment.