diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-11-17 14:35:36 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-11-28 10:28:14 +0100 |
commit | 2fa2e146ccf589aebb5865e5c1713a4ddef73345 (patch) | |
tree | f75fa7eb6a9d0a8b1dd1aaf4c1d695df8f918a40 /fftools/ffmpeg.c | |
parent | 334e52e09441213c9c391d7c0f5d0126eaa98396 (diff) |
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.
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r-- | fftools/ffmpeg.c | 7 |
1 files changed, 2 insertions, 5 deletions
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; |