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:
Kevin Mitchell 2017-07-08 15:22:42 -07:00
parent f4178b90c7
commit 2514e542e5
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}