Skip to content

Commit

Permalink
Fixed opening of capture devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Aug 14, 2019
1 parent 41b94f1 commit e1987d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mojoal.c
Expand Up @@ -2346,7 +2346,6 @@ ALCdevice *alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, AL
desired.freq = frequency;
desired.samples = 1024; FIXME("is this a reasonable value?");
desired.callback = capture_device_callback;
desired.userdata = device;

if (SDL_strcmp(devicename, DEFAULT_CAPTURE_DEVICE) != 0) {
sdldevname = devicename; /* we want NULL for the best SDL default unless app is explicit. */
Expand Down Expand Up @@ -2374,6 +2373,8 @@ ALCdevice *alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, AL

device->capture.ring.buffer = ringbuf;

desired.userdata = device;

device->sdldevice = SDL_OpenAudioDevice(sdldevname, 1, &desired, NULL, 0);
if (!device->sdldevice) {
SDL_free(ringbuf);
Expand Down

0 comments on commit e1987d1

Please sign in to comment.