提交 59b8c2a4 编写于 作者: M Michael Niedermayer

doc/examples/encode_audio: Favor a sample rate close to 44khz instead of the maximum sample rate

This is an example, people will copy and use this. The maximum supported is quite
unreasonable as a default choice
Reviewed-by: liuqi_123's avatarSteven Liu <lingjiujianke@gmail.com>
Signed-off-by: NMichael Niedermayer <michael@niedermayer.cc>
上级 004f27f0
......@@ -62,7 +62,8 @@ static int select_sample_rate(const AVCodec *codec)
p = codec->supported_samplerates;
while (*p) {
best_samplerate = FFMAX(*p, best_samplerate);
if (!best_samplerate || abs(44100 - *p) < abs(44100 - best_samplerate))
best_samplerate = *p;
p++;
}
return best_samplerate;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册