Py_BEGIN_ALLOW_THREADS was in the wrong scope.

This commit is contained in:
Lars Immisch
2023-09-04 13:45:57 +01:00
parent f374adb269
commit 3743cf5bd5
+2 -1
View File
@@ -1465,9 +1465,10 @@ static PyObject *alsapcm_write(alsapcm_t *self, PyObject *args)
int res;
snd_pcm_state_t state = snd_pcm_state(self->handle);
Py_BEGIN_ALLOW_THREADS
if ((state != SND_PCM_STATE_XRUN && state != SND_PCM_STATE_SETUP) ||
(res = snd_pcm_prepare(self->handle)) >= 0) {
Py_BEGIN_ALLOW_THREADS
res = snd_pcm_writei(self->handle, data, datalen/self->framesize);
if (res == -EPIPE) {
/* EPIPE means underrun */