lavfi: remove default config_props() callback and refactor avfilter_config_links()

Link properties have to be checked after config_props() is called to
make sure everything is sane, so the default config_props() for output
links was redundant.

Also remove channel_layout check as it is now negotiated.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
This commit is contained in:
Mina Nagy Zaki
2011-08-04 15:47:00 +03:00
committed by Stefano Sabatini
parent 4b7889453e
commit 5f68a91be2
3 changed files with 40 additions and 39 deletions

View File

@ -174,29 +174,6 @@ void avfilter_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *sa
inlink->cur_buf = NULL;
}
/**
* default config_link() implementation for output video links to simplify
* the implementation of one input one output video filters */
int avfilter_default_config_output_link(AVFilterLink *link)
{
if (link->src->input_count && link->src->inputs[0]) {
if (link->type == AVMEDIA_TYPE_VIDEO) {
link->w = link->src->inputs[0]->w;
link->h = link->src->inputs[0]->h;
link->time_base = link->src->inputs[0]->time_base;
} else if (link->type == AVMEDIA_TYPE_AUDIO) {
link->channel_layout = link->src->inputs[0]->channel_layout;
link->sample_rate = link->src->inputs[0]->sample_rate;
}
} else {
/* XXX: any non-simple filter which would cause this branch to be taken
* really should implement its own config_props() for this link. */
return -1;
}
return 0;
}
static void set_common_formats(AVFilterContext *ctx, AVFilterFormats *fmts,
enum AVMediaType type, int offin, int offout)
{