diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-09-16 12:38:31 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-09-16 20:44:26 +0200 |
commit | 71c644ceda80022c3f9e7dd23953e970968fa626 (patch) | |
tree | 72017e7b7d49697398f2a11dd26fdb8d7bebf718 /libavfilter/avfilter.c | |
parent | 4460b81f9ec3fb18c9fa118c33f7bfb07c172652 (diff) | |
download | ffmpeg-71c644ceda80022c3f9e7dd23953e970968fa626.tar.gz |
lavfi: set link audio time_base if not set in avfilter_config_links()
The set value depends on the input link, or on the sample_rate value.
Avoids the need to explicitely set the time_base value.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 78e91c8bf9..df1dd65b16 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -299,12 +299,17 @@ int avfilter_config_links(AVFilterContext *filter) if (link->src->input_count) { if (!link->sample_rate) link->sample_rate = link->src->inputs[0]->sample_rate; + if (!link->time_base.num && !link->time_base.den) + link->time_base = link->src->inputs[0]->time_base; } else if (!link->sample_rate) { av_log(link->src, AV_LOG_ERROR, "Audio source filters must set their output link's " "sample_rate\n"); return AVERROR(EINVAL); } + + if (!link->time_base.num && !link->time_base.den) + link->time_base = (AVRational) {1, link->sample_rate}; } if ((config_link = link->dstpad->config_props)) |