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

Stefano Sabatini stefano.sabatini-lala
Sun Feb 13 23:02:52 CET 2011


---
 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;
-- 
1.7.2.3




More information about the ffmpeg-devel mailing list