mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-06 17:29:08 +08:00
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>
This commit is contained in:
@@ -62,7 +62,8 @@ static int select_sample_rate(const AVCodec *codec)
|
|||||||
|
|
||||||
p = codec->supported_samplerates;
|
p = codec->supported_samplerates;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
best_samplerate = FFMAX(*p, best_samplerate);
|
if (!best_samplerate || abs(44100 - *p) < abs(44100 - best_samplerate))
|
||||||
|
best_samplerate = *p;
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
return best_samplerate;
|
return best_samplerate;
|
||||||
|
Reference in New Issue
Block a user