h264-encoder: Use AV_FRAME_FLAG_KEY instead of key_frame

pull/110/head
Andri Yngvason 2024-01-01 12:16:42 +00:00
parent f503cbef25
commit ddd5ee123e
1 changed files with 8 additions and 0 deletions

View File

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