From 2514e542e5e809603ce115563fd40d06e9fa8cb8 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sat, 8 Jul 2017 15:22:42 -0700 Subject: 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 --- audio/out/ao_wasapi_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 9bd0d00135..d260711d27 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -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); } -- cgit v1.2.3