From ddd5ee123e28a57b870d3d1d3569d9d6409fef1a Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Mon, 1 Jan 2024 12:16:42 +0000 Subject: [PATCH] h264-encoder: Use AV_FRAME_FLAG_KEY instead of key_frame --- src/h264-encoder.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/h264-encoder.c b/src/h264-encoder.c index 4cb3aff..6ad0262 100644 --- a/src/h264-encoder.c +++ b/src/h264-encoder.c @@ -409,10 +409,18 @@ static void h264_encoder__do_work(void* handle) frame->hw_frames_ctx = av_buffer_ref(self->hw_frames_ctx); if (self->current_frame_is_keyframe) { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 7, 100) + frame->flags |= AV_FRAME_FLAG_KEY; +#else frame->key_frame = 1; +#endif frame->pict_type = AV_PICTURE_TYPE_I; } else { +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 7, 100) + frame->flags &= ~AV_FRAME_FLAG_KEY; +#else frame->key_frame = 0; +#endif frame->pict_type = AV_PICTURE_TYPE_P; }