Skip to content

Commit

Permalink
Lock capture device before resetting state in alcCaptureStart().
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 30, 2019
1 parent c76cf57 commit 969f2d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mojoal.c
Expand Up @@ -2360,9 +2360,11 @@ static void _alcCaptureStart(ALCdevice *device)
if (device && device->iscapture) {
/* alcCaptureStart() drops any previously-buffered data. */
FIXME("does this clear the ring buffer if the device is already started?");
SDL_LockAudioDevice(device->sdldevice);
device->capture.ring.read = 0;
device->capture.ring.write = 0;
device->capture.ring.used = 0;
SDL_UnlockAudioDevice(device->sdldevice);
SDL_PauseAudioDevice(device->sdldevice, 0);
}
}
Expand Down

0 comments on commit 969f2d1

Please sign in to comment.