You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avfilter/af_aresample: merge request_frame into activate function
No functional change. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@ -302,14 +302,26 @@ static int flush_frame(AVFilterLink *outlink, int final, AVFrame **outsamplesref
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int request_frame(AVFilterLink *outlink)
|
static int activate(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = outlink->src;
|
|
||||||
AVFilterLink *inlink = ctx->inputs[0];
|
AVFilterLink *inlink = ctx->inputs[0];
|
||||||
|
AVFilterLink *outlink = ctx->outputs[0];
|
||||||
AResampleContext *aresample = ctx->priv;
|
AResampleContext *aresample = ctx->priv;
|
||||||
int ret = 0, status;
|
int ret = 0, status;
|
||||||
int64_t pts;
|
int64_t pts;
|
||||||
|
|
||||||
|
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
|
||||||
|
|
||||||
|
if (!aresample->eof && ff_inlink_queued_frames(inlink)) {
|
||||||
|
AVFrame *frame = NULL;
|
||||||
|
|
||||||
|
ret = ff_inlink_consume_frame(inlink, &frame);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
if (ret > 0)
|
||||||
|
return filter_frame(inlink, frame);
|
||||||
|
}
|
||||||
|
|
||||||
// First try to get data from the internal buffers
|
// First try to get data from the internal buffers
|
||||||
if (aresample->more_data) {
|
if (aresample->more_data) {
|
||||||
AVFrame *outsamplesref;
|
AVFrame *outsamplesref;
|
||||||
@ -346,28 +358,6 @@ static int request_frame(AVFilterLink *outlink)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int activate(AVFilterContext *ctx)
|
|
||||||
{
|
|
||||||
AResampleContext *aresample = ctx->priv;
|
|
||||||
AVFilterLink *inlink = ctx->inputs[0];
|
|
||||||
AVFilterLink *outlink = ctx->outputs[0];
|
|
||||||
|
|
||||||
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
|
|
||||||
|
|
||||||
if (!aresample->eof && ff_inlink_queued_frames(inlink)) {
|
|
||||||
AVFrame *frame = NULL;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = ff_inlink_consume_frame(inlink, &frame);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
if (ret > 0)
|
|
||||||
return filter_frame(inlink, frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
return request_frame(outlink);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const AVClass *resample_child_class_iterate(void **iter)
|
static const AVClass *resample_child_class_iterate(void **iter)
|
||||||
{
|
{
|
||||||
const AVClass *c = *iter ? NULL : swr_get_class();
|
const AVClass *c = *iter ? NULL : swr_get_class();
|
||||||
|
Reference in New Issue
Block a user