From 2fa2e146ccf589aebb5865e5c1713a4ddef73345 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 17 Nov 2022 14:35:36 +0100 Subject: fftools/ffmpeg: avoid storing full forced keyframe spec It is not needed after the spec is parsed. Also avoids ugly string comparisons for each video frame. --- fftools/ffmpeg.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'fftools/ffmpeg.c') diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 12ce108cc6..44582e3568 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1067,13 +1067,10 @@ static enum AVPictureType forced_kf_apply(KeyframeForceCtx *kf, AVRational tb, kf->expr_const_values[FKF_N_FORCED] += 1; goto force_keyframe; } - } else if (kf->forced_keyframes && - !strncmp(kf->forced_keyframes, "source", 6) && + } else if (kf->type == KF_FORCE_SOURCE && in_picture->key_frame == 1 && !dup_idx) { goto force_keyframe; - } else if (kf->forced_keyframes && - !strncmp(kf->forced_keyframes, "source_no_drop", 14) && - !dup_idx) { + } else if (kf->type == KF_FORCE_SOURCE_NO_DROP && !dup_idx) { kf->dropped_keyframe = 0; if ((in_picture->key_frame == 1) || kf->dropped_keyframe) goto force_keyframe; -- cgit v1.2.3