From 8bf76def09e0747734c33a21a8f94b3f462305c7 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 1 Oct 2023 11:23:51 +0200 Subject: [PATCH] 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. --- nageru/ffmpeg_capture.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.39.2