mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
ao_wasapi: use new af_select_best_samplerate function
It duplicates the logic that was previously used here.
This commit is contained in:
parent
a0884c82a9
commit
96053d53a7
@ -364,17 +364,9 @@ static bool search_samplerates(struct ao *ao, WAVEFORMATEXTENSIBLE *wformat,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; supported[i]; i++) {
|
int samplerate = af_select_best_samplerate(ao->samplerate, supported);
|
||||||
// first choose the lowest integer multiple of the sample rate
|
if (samplerate > 0) {
|
||||||
if (!(supported[i] % ao->samplerate)) {
|
change_waveformat_samplerate(wformat, samplerate);
|
||||||
change_waveformat_samplerate(wformat, supported[i]);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// then choose the highest supported (if any)
|
|
||||||
if (n) {
|
|
||||||
change_waveformat_samplerate(wformat, supported[n-1]);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user