From: Steinar H. Gunderson Date: Sun, 1 Oct 2023 09:23:51 +0000 (+0200) Subject: Use AVFrame::duration instead of AVFrame::pkt_duration. X-Git-Tag: 2.3.0~6 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=8bf76def09e0747734c33a21a8f94b3f462305c7 Use AVFrame::duration instead of AVFrame::pkt_duration. This field was introduced in FFmpeg 5.2 and then the old one promptly deprecated; the difference seems to be effectively nil? Use an #ifdef so that we retain bookworm (FFmpeg 5.1) compatibility. --- diff --git a/nageru/ffmpeg_capture.cpp b/nageru/ffmpeg_capture.cpp index 09c1d26..4b9d477 100644 --- a/nageru/ffmpeg_capture.cpp +++ b/nageru/ffmpeg_capture.cpp @@ -50,6 +50,11 @@ using namespace bmusb; using namespace movit; using namespace Eigen; +// Avoid deprecation warnings, but we don't want to drop FFmpeg 5.1 support just yet. +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 30, 100) +#define pkt_duration duration +#endif + namespace { steady_clock::time_point compute_frame_start(int64_t frame_pts, int64_t pts_origin, const AVRational &video_timebase, const steady_clock::time_point &origin, double rate)