History

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.

Stefano Sabatini committed 15 years ago

Commit 71c644c1 parent 4460b811 file · +5 −0Browse files

Unified · Split

libavfilter/avfilter.c+5−0
@@ -299,12 +299,17 @@ int avfilter_config_links(AVFilterContext *filter) · 298 unmodified lines
299299 if (link->src->input_count) {
300300 if (!link->sample_rate)
301301 link->sample_rate = link->src->inputs[0]->sample_rate;
302+ if (!link->time_base.num && !link->time_base.den)
303+ link->time_base = link->src->inputs[0]->time_base;
302304 } else if (!link->sample_rate) {
303305 av_log(link->src, AV_LOG_ERROR,
304306 "Audio source filters must set their output link's "
305307 "sample_rate\n");
306308 return AVERROR(EINVAL);
307309 }
310+
311+ if (!link->time_base.num && !link->time_base.den)
312+ link->time_base = (AVRational) {1, link->sample_rate};
308313 }
309314
310315 if ((config_link = link->dstpad->config_props))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t