From 167b4add501fe128d48da8de0fe4e48797cdd2b5 Mon Sep 17 00:00:00 2001 From: 0tkl <118708188+0tkl@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:51:04 +0800 Subject: [PATCH] bestsource: Update ffmpeg API usage for keyframes --- src/video_provider_bestsource.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_provider_bestsource.cpp b/src/video_provider_bestsource.cpp index 2d7c6c952..c7412a4e0 100644 --- a/src/video_provider_bestsource.cpp +++ b/src/video_provider_bestsource.cpp @@ -137,8 +137,11 @@ BSVideoProvider::BSVideoProvider(agi::fs::path const& filename, std::string cons if (frame == nullptr) { throw VideoOpenError("Couldn't read frame!"); } - +#if (LIBAVUTIL_VERSION_MAJOR == 58 && LIBAVUTIL_VERSION_MINOR >= 7) || LIBAVUTIL_VERSION_MAJOR >= 59 + if (frame->GetAVFrame()->flags & AV_FRAME_FLAG_KEY) { +#else if (frame->GetAVFrame()->key_frame) { +#endif Keyframes.push_back(n); }