]> git.sesse.net Git - nageru/commitdiff
Use AVFrame::duration instead of AVFrame::pkt_duration.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 1 Oct 2023 09:23:51 +0000 (11:23 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 1 Oct 2023 09:23:51 +0000 (11:23 +0200)
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

index 09c1d26e15b3642be4ea64eff4fa3e8da606c01c..4b9d477648cdbc8ee7e3efedfb79e112e972a2b3 100644 (file)
@@ -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)