summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-07 17:41:44 +0200
committerwm4 <wm4@nowhere>2017-07-07 17:56:18 +0200
commit4e11549593f96d876f809b4916f3a7edb7e390b5 (patch)
treef28b767f83261cfaaa847902bfb04d0a6701fbfe
parent951c1a4907b107ab2da6509fc6aa99ca30591e08 (diff)
downloadmpv-4e11549593f96d876f809b4916f3a7edb7e390b5.tar.bz2
mpv-4e11549593f96d876f809b4916f3a7edb7e390b5.tar.xz
ao_wasapi_utils: be slightly more clever when converting channel map
-rw-r--r--audio/out/ao_wasapi_utils.c5
1 files changed, 5 insertions, 0 deletions
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.)