bestsource: Update ffmpeg API usage for keyframes

This commit is contained in:
0tkl 2023-11-09 14:51:04 +08:00 committed by arch1t3cht
parent 0c057ebddb
commit 167b4add50
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}