summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-12-15 02:08:23 -0800
committerKevin Mitchell <kevmitch@gmail.com>2014-12-15 05:01:38 -0800
commit4966a67f71d8a1d7beece7da46198a5c804e8c68 (patch)
tree0726239c19614b5effd4ea701be45523a4a38df7 /audio/out
parentfcec3df700386139c1fcd11bdd7c501ce26b6913 (diff)
downloadmpv-4966a67f71d8a1d7beece7da46198a5c804e8c68.tar.bz2
mpv-4966a67f71d8a1d7beece7da46198a5c804e8c68.tar.xz
ao/wasapi: set the ao with the waveformat channelmap
hopefully this fixes #1350
Diffstat (limited to 'audio/out')
-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;