Update periodsize only after alsapcm_setup succeeded

This commit is contained in:
Lars Immisch
2018-02-28 00:35:26 +01:00
parent 723eff3887
commit 1aae655d24

View File

@@ -743,7 +743,6 @@ alsapcm_setperiodsize(alsapcm_t *self, PyObject *args)
return NULL;
}
self->periodsize = periodsize;
res = alsapcm_setup(self);
if (res < 0)
{
@@ -752,6 +751,8 @@ alsapcm_setperiodsize(alsapcm_t *self, PyObject *args)
return NULL;
}
self->periodsize = periodsize;
return PyLong_FromLong(self->periodsize);
}