From: Stephen Seo Date: Thu, 7 Mar 2024 07:15:19 +0000 (+0900) Subject: Fix usage of deprecated AVFrame::pkt_duration X-Git-Url: https://git.seodisparate.com/stephenseo/static/git-logo.png?a=commitdiff_plain;h=1d27fd3b2103b34c110567ec1efb9490a40dd668;p=EN605.617.81.FA21_StephenSeo_DitheringProject Fix usage of deprecated AVFrame::pkt_duration Uses a macro to check FFMpeg version before setting AVFrame::duration or AVFrame::pkt_duration. --- 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)