ao/wasapi: set the ao with the waveformat channelmap

hopefully this fixes #1350
This commit is contained in:
Kevin Mitchell 2014-12-15 02:08:23 -08:00
parent fcec3df700
commit 4966a67f71
1 changed files with 10 additions and 1 deletions

View File

@ -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;