diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2017-07-08 15:22:42 -0700 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2017-07-09 13:43:54 -0700 |
commit | 2514e542e5e809603ce115563fd40d06e9fa8cb8 (patch) | |
tree | 71df40d4f3cccb431023284de3b1aecf46f1bde0 /audio/out/ao_wasapi_utils.c | |
parent | f4178b90c759bfcab0ea99750f99c1b3c5e91aea (diff) | |
download | mpv-2514e542e5e809603ce115563fd40d06e9fa8cb8.tar.bz2 mpv-2514e542e5e809603ce115563fd40d06e9fa8cb8.tar.xz |
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
Diffstat (limited to 'audio/out/ao_wasapi_utils.c')
-rw-r--r-- | audio/out/ao_wasapi_utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); } |