From 4e11549593f96d876f809b4916f3a7edb7e390b5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 7 Jul 2017 17:41:44 +0200 Subject: ao_wasapi_utils: be slightly more clever when converting channel map --- audio/out/ao_wasapi_utils.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'audio') diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index ce0d6cf225..9bd0d00135 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -153,7 +153,12 @@ static void set_waveformat(WAVEFORMATEXTENSIBLE *wformat, static void set_waveformat_with_ao(WAVEFORMATEXTENSIBLE *wformat, struct ao *ao) { struct mp_chmap channels = ao->channels; + + if (mp_chmap_is_unknown(&channels)) + mp_chmap_from_channels(&channels, channels.num); mp_chmap_reorder_to_waveext(&channels); + if (!mp_chmap_is_valid(&channels)) + mp_chmap_from_channels(&channels, 2); // First find a format that is actually representable. // (Notably excludes AF_FORMAT_DOUBLE.) -- cgit v1.2.3