From 4966a67f71d8a1d7beece7da46198a5c804e8c68 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Mon, 15 Dec 2014 02:08:23 -0800 Subject: ao/wasapi: set the ao with the waveformat channelmap hopefully this fixes #1350 --- audio/out/ao_wasapi_utils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'audio/out') diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 7be636753e..0000995349 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -280,8 +280,17 @@ static bool set_ao_format(struct ao *ao, WAVEFORMATEX *wf) ao->bps = wf->nAvgBytesPerSec; ao->format = format; - if (ao->channels.num != wf->nChannels) + if ( wf->wFormatTag == WAVE_FORMAT_EXTENSIBLE ){ + WAVEFORMATEXTENSIBLE *wformat = (WAVEFORMATEXTENSIBLE *)wf; + mp_chmap_from_waveext(&ao->channels, wformat->dwChannelMask); + } else { mp_chmap_from_channels(&ao->channels, wf->nChannels); + } + + if ( ao->channels.num != wf->nChannels ) { + MP_ERR(ao, "Channel map doesn't match number of channels\n"); + return false; + } waveformat_copy(&state->format, wf); return true; -- cgit v1.2.3