Merge pull request #1893 from jpark37/fix-win-speaker-macros

win-wasapi: Speaker enum fixes
This commit is contained in:
Jim 2019-05-23 22:20:56 -07:00 committed by GitHub
commit 82afc219f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,9 +16,8 @@ using namespace std;
static void GetWASAPIDefaults(obs_data_t *settings);
// Fix inconsistent defs of speaker_surround between avutil & wasapi
#define KSAUDIO_SPEAKER_2POINT1 (KSAUDIO_SPEAKER_STEREO|SPEAKER_LOW_FREQUENCY)
#define KSAUDIO_SPEAKER_4POINT1 (KSAUDIO_SPEAKER_QUAD|SPEAKER_LOW_FREQUENCY)
#define OBS_KSAUDIO_SPEAKER_4POINT1 \
(KSAUDIO_SPEAKER_SURROUND|SPEAKER_LOW_FREQUENCY)
class WASAPISource {
ComPtr<IMMDevice> device;
@ -245,7 +244,7 @@ static speaker_layout ConvertSpeakerLayout(DWORD layout, WORD channels)
switch (layout) {
case KSAUDIO_SPEAKER_2POINT1: return SPEAKERS_2POINT1;
case KSAUDIO_SPEAKER_SURROUND: return SPEAKERS_4POINT0;
case KSAUDIO_SPEAKER_4POINT1: return SPEAKERS_4POINT1;
case OBS_KSAUDIO_SPEAKER_4POINT1: return SPEAKERS_4POINT1;
case KSAUDIO_SPEAKER_5POINT1_SURROUND: return SPEAKERS_5POINT1;
case KSAUDIO_SPEAKER_7POINT1_SURROUND: return SPEAKERS_7POINT1;
}