Fix usage of deprecated AVFrame::pkt_duration

Uses a macro to check FFMpeg version before setting AVFrame::duration or
AVFrame::pkt_duration.
This commit is contained in:
Stephen Seo 2024-03-07 16:15:19 +09:00
parent 2e03098540
commit 1d27fd3b21

View file

@ -614,7 +614,11 @@ std::tuple<bool, std::vector<AVFrame *>> 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)