ao/wasapi: set the ao with the waveformat channelmap

hopefully this fixes #1350
This commit is contained in:
Kevin Mitchell
2015-01-25 17:00:17 +09:00
committed by Diogo Franco (Kovensky)
parent 2090a35c57
commit 307b8925ee
+10 -1
View File
@@ -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;