From 1d27fd3b2103b34c110567ec1efb9490a40dd668 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Thu, 7 Mar 2024 16:15:19 +0900 Subject: [PATCH] Fix usage of deprecated AVFrame::pkt_duration Uses a macro to check FFMpeg version before setting AVFrame::duration or AVFrame::pkt_duration. --- src/video.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video.cc b/src/video.cc index 146c5c0..32a5d03 100644 --- a/src/video.cc +++ b/src/video.cc @@ -614,7 +614,11 @@ std::tuple> Video::HandleDecodingPacket( // cleanup av_frame_free(&temp_frame); yuv_frame->pts = frame_count_ - 1; +#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(58, 2, 100) yuv_frame->pkt_duration = 1; +#else + yuv_frame->duration = 1; +#endif return_frames.push_back(yuv_frame); } // else (!output_as_pngs) } // while (return_value >= 0)