Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-03-30 16:12:19 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-03-30 17:34:06 +0300
commit59b8c2a4e668d129dedfab696cd8c07f5103343c (patch)
tree846faa07e3430c9f4f01b54d5b589bdebec788b1 /doc
parent004f27f0fb6e8ebf6b4078c77d21b0f248a2213f (diff)
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: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/encode_audio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/examples/encode_audio.c b/doc/examples/encode_audio.c
index 88d0a6fd46..ba9ef6ddb8 100644
--- a/doc/examples/encode_audio.c
+++ b/doc/examples/encode_audio.c
@@ -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;