recording: fix default sample rate

This commit is contained in:
Megamouse 2023-11-13 22:11:10 +01:00
parent 64529cefa5
commit 42cd7df813
1 changed files with 2 additions and 2 deletions

View File

@ -302,12 +302,12 @@ namespace utils
static int select_sample_rate(const AVCodec* codec)
{
if (!codec->supported_samplerates)
return 44100;
return 48000;
int best_samplerate = 0;
for (const int* samplerate = codec->supported_samplerates; samplerate && *samplerate != 0; samplerate++)
{
if (!best_samplerate || abs(44100 - *samplerate) < abs(44100 - best_samplerate))
if (!best_samplerate || abs(48000 - *samplerate) < abs(48000 - best_samplerate))
{
best_samplerate = *samplerate;
}