Commit 59b8c2a4 authored by Michael Niedermayer's avatar 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: 's avatarSteven Liu <lingjiujianke@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment