mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 18:49:58 +00:00
avfilter/af_adrc: rework activate()
This commit is contained in:
parent
beb0f183bf
commit
56fd1ce3ae
@ -275,9 +275,8 @@ static int activate(AVFilterContext *ctx)
|
|||||||
AVFilterLink *inlink = ctx->inputs[0];
|
AVFilterLink *inlink = ctx->inputs[0];
|
||||||
AVFilterLink *outlink = ctx->outputs[0];
|
AVFilterLink *outlink = ctx->outputs[0];
|
||||||
AudioDRCContext *s = ctx->priv;
|
AudioDRCContext *s = ctx->priv;
|
||||||
int ret, status, available, wanted;
|
int ret, available, wanted;
|
||||||
AVFrame *in = NULL;
|
AVFrame *in = NULL;
|
||||||
int64_t pts;
|
|
||||||
|
|
||||||
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
|
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
|
||||||
|
|
||||||
@ -292,17 +291,17 @@ static int activate(AVFilterContext *ctx)
|
|||||||
s->release = get_coef(s->release_ms, inlink->sample_rate);
|
s->release = get_coef(s->release_ms, inlink->sample_rate);
|
||||||
|
|
||||||
return filter_frame(inlink, in);
|
return filter_frame(inlink, in);
|
||||||
} else if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
|
}
|
||||||
ff_outlink_set_status(outlink, status, pts);
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
if (ff_inlink_queued_samples(inlink) >= s->overlap) {
|
if (ff_inlink_queued_samples(inlink) >= s->overlap) {
|
||||||
ff_filter_set_ready(ctx, 10);
|
ff_filter_set_ready(ctx, 10);
|
||||||
} else if (ff_outlink_frame_wanted(outlink)) {
|
|
||||||
ff_inlink_request_frame(inlink);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FF_FILTER_FORWARD_STATUS(inlink, outlink);
|
||||||
|
FF_FILTER_FORWARD_WANTED(outlink, inlink);
|
||||||
|
|
||||||
|
return FFERROR_NOT_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold void uninit(AVFilterContext *ctx)
|
static av_cold void uninit(AVFilterContext *ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user