Skip to content

Commit 85dfdda

Browse files
committed
Allow SDL to change channel count and log audio driver.
1 parent ec1d6f4 commit 85dfdda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/AudioCaptureImpl_SDL.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ void AudioCaptureImpl::StartRecording(projectm* projectMHandle, int audioDeviceI
5555
_projectMHandle = projectMHandle;
5656
_currentAudioDeviceIndex = audioDeviceIndex;
5757

58+
poco_debug_f1(_logger, "Using SDL audio driver \"%s\".", std::string(SDL_GetCurrentAudioDriver()));
59+
5860
if (OpenAudioDevice())
5961
{
6062
SDL_PauseAudioDevice(_currentAudioDeviceID, false);
@@ -125,7 +127,7 @@ bool AudioCaptureImpl::OpenAudioDevice()
125127

126128
// Will be NULL on error, which happens if the requested index is -1. This automatically selects the default device.
127129
auto deviceName = SDL_GetAudioDeviceName(_currentAudioDeviceIndex, true);
128-
_currentAudioDeviceID = SDL_OpenAudioDevice(deviceName, true, &requestedSpecs, &actualSpecs, 0);
130+
_currentAudioDeviceID = SDL_OpenAudioDevice(deviceName, true, &requestedSpecs, &actualSpecs, SDL_AUDIO_ALLOW_CHANNELS_CHANGE);
129131

130132
if (_currentAudioDeviceID == 0)
131133
{

0 commit comments

Comments
 (0)