[FFmpeg-devel] [PATCH] Make avfilter_config_links() propagate audio information of the source link if it is not explicitely set by the filter.
Justin Ruggles
justin.ruggles
Mon Feb 14 13:19:43 CET 2011
On 02/13/2011 05:02 PM, Stefano Sabatini wrote:
> ---
> 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;
> +
> if ((config_link = link->dstpad->config_props))
> if ((ret = config_link(link)) < 0)
> return ret;
looks ok to me.
-Justin
More information about the ffmpeg-devel
mailing list