summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao_wasapi_utils.c')
-rwxr-xr-xaudio/out/ao_wasapi_utils.c11
1 files changed, 10 insertions, 1 deletions
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;