aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2024-03-01 19:03:52 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2024-03-11 15:38:13 +0530
commit3d1860ec8db7f9785bf1338e826138c0218dfb59 (patch)
tree4205daa3e1b3f6b85965018401fb6edda81bbdb6 /libavfilter/avfilter.c
parentc31d2326560087b80f8523b27060ad6388369cac (diff)
downloadffmpeg-3d1860ec8db7f9785bf1338e826138c0218dfb59.tar.gz
avfilter: update filter timeline state only on main link
At present, consume_update evaluates timeline state on all links for a multi-input filter. This can lead to the filter being incorrectly en/dis-abled when evaluation on a frame on a secondary link leads to a different result than the frame on the current main link next in line for processing.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index c323ebb4b8..831871de90 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1436,7 +1436,8 @@ static void consume_update(FilterLinkInternal *li, const AVFrame *frame)
AVFilterLink *const link = &li->l;
update_link_current_pts(li, frame->pts);
ff_inlink_process_commands(link, frame);
- link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
+ if (link == link->dst->inputs[0])
+ link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
link->frame_count_out++;
link->sample_count_out += frame->nb_samples;
}