aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-04-01 06:29:16 +0200
committerAnton Khirnov <anton@khirnov.net>2024-04-09 10:34:18 +0200
commit509afedaafa1c6796dac6c5654a1229d6af945bb (patch)
tree1cbe50ffb8415674c0ebd6f288800aeb91f0176d /fftools/ffmpeg_filter.c
parentbc206ed1b3631801869b1bd4ddb3d3e4dd5f7aef (diff)
downloadffmpeg-509afedaafa1c6796dac6c5654a1229d6af945bb.tar.gz
fftools/ffmpeg_filter: pass vsync method through OutputFilterOptions
Do not read it from OutputStream directly. Will allow decoupling filtering from encoding in future commits.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r--fftools/ffmpeg_filter.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 3c25d2ed65..d906b72576 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -175,6 +175,8 @@ typedef struct FPSConvContext {
int last_dropped;
int dropped_keyframe;
+ enum VideoSyncMethod vsync_method;
+
AVRational framerate;
AVRational framerate_max;
const AVRational *framerate_supported;
@@ -799,6 +801,7 @@ int ofilter_bind_ost(OutputFilter *ofilter, OutputStream *ost,
if (!ofp->fps.last_frame)
return AVERROR(ENOMEM);
+ ofp->fps.vsync_method = opts->vsync_method;
ofp->fps.framerate = ost->frame_rate;
ofp->fps.framerate_max = ost->max_frame_rate;
ofp->fps.framerate_supported = ost->force_fps && opts->enc ?
@@ -2072,9 +2075,9 @@ static void video_sync_process(OutputFilterPriv *ofp, AVFrame *frame,
if (delta0 < 0 &&
delta > 0 &&
- ost->vsync_method != VSYNC_PASSTHROUGH
+ fps->vsync_method != VSYNC_PASSTHROUGH
#if FFMPEG_OPT_VSYNC_DROP
- && ost->vsync_method != VSYNC_DROP
+ && fps->vsync_method != VSYNC_DROP
#endif
) {
if (delta0 < -0.6) {
@@ -2086,7 +2089,7 @@ static void video_sync_process(OutputFilterPriv *ofp, AVFrame *frame,
delta0 = 0;
}
- switch (ost->vsync_method) {
+ switch (fps->vsync_method) {
case VSYNC_VSCFR:
if (fps->frame_number == 0 && delta0 >= 0.5) {
av_log(ost, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0));