aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_asetnsamples.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-05 20:53:39 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-07 17:25:07 +0200
commit782ea8b2e5a96bb18a45210f94fb427009e996b1 (patch)
treed773ecdc1dd2b8cba074f0aa846ddb15285c8ad3 /libavfilter/af_asetnsamples.c
parent03800bcaf3f341de4307f47626f64c0a2545c09c (diff)
downloadffmpeg-782ea8b2e5a96bb18a45210f94fb427009e996b1.tar.gz
avfilter/af_asetnsamples: add timeline support
Diffstat (limited to 'libavfilter/af_asetnsamples.c')
-rw-r--r--libavfilter/af_asetnsamples.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index fe6d40f9ca..20cc70ce4a 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -61,12 +61,15 @@ static int activate(AVFilterContext *ctx)
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- ret = ff_inlink_consume_samples(inlink, s->nb_out_samples, s->nb_out_samples, &frame);
+ if (ctx->is_disabled)
+ ret = ff_inlink_consume_frame(inlink, &frame);
+ else
+ ret = ff_inlink_consume_samples(inlink, s->nb_out_samples, s->nb_out_samples, &frame);
if (ret < 0)
return ret;
if (ret > 0) {
- if (!s->pad || frame->nb_samples == s->nb_out_samples)
+ if (!s->pad || ctx->is_disabled || frame->nb_samples == s->nb_out_samples)
return ff_filter_frame(outlink, frame);
pad_frame = ff_get_audio_buffer(outlink, s->nb_out_samples);
@@ -123,5 +126,6 @@ const AVFilter ff_af_asetnsamples = {
FILTER_INPUTS(asetnsamples_inputs),
FILTER_OUTPUTS(asetnsamples_outputs),
.activate = activate,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
.process_command = ff_filter_process_command,
};