diff --git a/src/media.cpp b/src/media.cpp index 8102b77b..59b285ce 100644 --- a/src/media.cpp +++ b/src/media.cpp @@ -778,8 +778,12 @@ void FeVideoImp::video_thread() if ( raw_frame->pts == AV_NOPTS_VALUE ) raw_frame->pts = packet->dts; - -#if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 30, 100 )) +// AVFrame.pkt_duration renamed to AVFrame.duration with FFmpeg 6 +#define XSTR(x) STR(x) +#define STR(x) #x +#pragma message "The value of LIBAVCODEC_VERSION_INT: " XSTR(LIBAVUTIL_VERSION_INT) +#pragma message "The value of AV_VERSION_INT( 58, 2, 100 ): " XSTR(AV_VERSION_INT( 58, 2, 100 )) +#if (LIBAVUTIL_VERSION_INT < AV_VERSION_INT( 58, 2, 100 )) // Correct for out of bounds pts if ( raw_frame->pts < prev_pts ) raw_frame->pts = prev_pts + prev_duration; @@ -787,7 +791,7 @@ void FeVideoImp::video_thread() // Track pts and duration if we need to correct next frame prev_pts = raw_frame->pts; prev_duration = raw_frame->duration; -#elif (LIBAVUTIL_VERSION_MICRO >= 100 ) +#elif (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 58, 2, 100 )) // This only works on FFmpeg, exclude libav (it doesn't have pkt_duration // Correct for out of bounds pts if ( raw_frame->pts < prev_pts )