[FFmpeg-devel] [PATCH] Make avfilter_config_links() propagate audio information of the source link if it is not explicitely set by the filter.

Måns Rullgård mans
Mon Feb 14 13:36:56 CET 2011


Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:

> ---
>  libavfilter/avfilter.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> index 31af890..1c400a6 100644
> --- a/libavfilter/avfilter.c
> +++ b/libavfilter/avfilter.c
> @@ -194,6 +194,12 @@ int avfilter_config_links(AVFilterContext *filter)
>                  link->time_base = link->src && link->src->input_count ?
>                      link->src->inputs[0]->time_base : AV_TIME_BASE_Q;
>
> +            if (link->sample_rate == 0 && link->src && link->src->input_count)
> +                link->sample_rate = link->src->inputs[0]->sample_rate;
> +
> +            if (link->channel_layout == 0 && link->src && link->src->input_count)
> +                link->channel_layout = link->src->inputs[0]->channel_layout;
> +

What if there is more than one input?  Are more complex cases assumed to
provide explicit parameters?  Is this input certain to be an audio input?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list