diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-08-05 11:41:53 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-08-15 19:27:01 +0200 |
commit | 99ee7a948fd5bc014ce5a4160a71ffb068fd21e2 (patch) | |
tree | e7eab456084080a6d59b073bafd88691a34d23cb /libavfilter/avfilter.c | |
parent | 54754eec1e4b4882e7bbe1fbf4374c11d955eb36 (diff) | |
download | ffmpeg-99ee7a948fd5bc014ce5a4160a71ffb068fd21e2.tar.gz |
lavfi: move AVFilterLink.m{ax,in}_samples to FilterLink
Also, document who sets these fields and when.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 80c9cf7b51..75e9bf6724 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1077,14 +1077,15 @@ static int samples_ready(FilterLinkInternal *link, unsigned min) static int take_samples(FilterLinkInternal *li, unsigned min, unsigned max, AVFrame **rframe) { - AVFilterLink *link = &li->l.pub; + FilterLink *l = &li->l; + AVFilterLink *link = &l->pub; AVFrame *frame0, *frame, *buf; unsigned nb_samples, nb_frames, i, p; int ret; /* Note: this function relies on no format changes and must only be called with enough samples. */ - av_assert1(samples_ready(li, link->min_samples)); + av_assert1(samples_ready(li, l->min_samples)); frame0 = frame = ff_framequeue_peek(&li->fifo, 0); if (!li->fifo.samples_skipped && frame->nb_samples >= min && frame->nb_samples <= max) { *rframe = ff_framequeue_take(&li->fifo); @@ -1142,8 +1143,8 @@ static int ff_filter_frame_to_filter(AVFilterLink *link) int ret; av_assert1(ff_framequeue_queued_frames(&li->fifo)); - ret = link->min_samples ? - ff_inlink_consume_samples(link, link->min_samples, link->max_samples, &frame) : + ret = li->l.min_samples ? + ff_inlink_consume_samples(link, li->l.min_samples, li->l.max_samples, &frame) : ff_inlink_consume_frame(link, &frame); av_assert1(ret); if (ret < 0) { @@ -1218,8 +1219,8 @@ static int ff_filter_activate_default(AVFilterContext *filter) } for (i = 0; i < filter->nb_inputs; i++) { - if (samples_ready(ff_link_internal(filter->inputs[i]), - filter->inputs[i]->min_samples)) { + FilterLinkInternal *li = ff_link_internal(filter->inputs[i]); + if (samples_ready(li, li->l.min_samples)) { return ff_filter_frame_to_filter(filter->inputs[i]); } } |