mirror of https://github.com/mpv-player/mpv
ao_wasapi: try correct initial format
The loop to select the native wasapi_format for the incoming audio was not breaking correctly when it found the most desirable format. It therefore executed completely leaving the least desirable format (u8) as the choice. fixes #4582
This commit is contained in:
parent
f4178b90c7
commit
2514e542e5
|
@ -169,10 +169,13 @@ static void set_waveformat_with_ao(WAVEFORMATEXTENSIBLE *wformat, struct ao *ao)
|
|||
af_get_best_sample_formats(ao->format, alt_formats);
|
||||
for (int n = 0; alt_formats[n]; n++) {
|
||||
for (int i = 0; wasapi_formats[i].mp_format; i++) {
|
||||
if (wasapi_formats[i].mp_format == alt_formats[n])
|
||||
if (wasapi_formats[i].mp_format == alt_formats[n]) {
|
||||
format = wasapi_formats[i];
|
||||
goto found_format;
|
||||
}
|
||||
}
|
||||
}
|
||||
found_format:
|
||||
|
||||
set_waveformat(wformat, format, ao->samplerate, &channels);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue