diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-12-15 02:08:23 -0800 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:17 +0900 |
commit | 307b8925ee84c02936d78cee84f13d03f01418e1 (patch) | |
tree | bf9911648e81eec2f87206ca70abce7b264fcd26 /audio | |
parent | 2090a35c57e9487a1aee1c5d00f323cd6d3ab9d2 (diff) | |
download | mpv-307b8925ee84c02936d78cee84f13d03f01418e1.tar.bz2 mpv-307b8925ee84c02936d78cee84f13d03f01418e1.tar.xz |
ao/wasapi: set the ao with the waveformat channelmap
hopefully this fixes #1350
Diffstat (limited to 'audio')
-rwxr-xr-x | audio/out/ao_wasapi_utils.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index 53a257c356..d0eecc24bc 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -298,8 +298,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; |