summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/linuxaudiodev.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c
index 37ad5ff..e0f144b 100644
--- a/Modules/linuxaudiodev.c
+++ b/Modules/linuxaudiodev.c
@@ -258,15 +258,6 @@ lad_setparameters(lad_t *self, PyObject *args)
return NULL;
}
- if (ioctl(self->x_fd, SNDCTL_DSP_SPEED, &rate) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
- if (ioctl(self->x_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1) {
- PyErr_SetFromErrno(LinuxAudioError);
- return NULL;
- }
-
for (n = 0; n < n_audio_types; n++)
if (fmt == audio_types[n].a_fmt)
break;
@@ -294,6 +285,14 @@ lad_setparameters(lad_t *self, PyObject *args)
PyErr_SetFromErrno(LinuxAudioError);
return NULL;
}
+ if (ioctl(self->x_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1) {
+ PyErr_SetFromErrno(LinuxAudioError);
+ return NULL;
+ }
+ if (ioctl(self->x_fd, SNDCTL_DSP_SPEED, &rate) == -1) {
+ PyErr_SetFromErrno(LinuxAudioError);
+ return NULL;
+ }
Py_INCREF(Py_None);
return Py_None;