mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Use fcntl() to put the audio device *back* into blocking mode after
opening it in non-blocking mode. Both Guido and David Hammerton have reported that this fixes their problems with ossaudiodev -- hooray!
This commit is contained in:
parent
059b094e29
commit
76ffb1918d
1 changed files with 9 additions and 0 deletions
|
@ -139,6 +139,15 @@ newossobject(PyObject *arg)
|
|||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, basedev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* And (try to) put it back in blocking mode so we get the
|
||||
expected write() semantics. */
|
||||
if (fcntl(fd, F_SETFL, 0) == -1) {
|
||||
close(fd);
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, basedev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ioctl(fd, SNDCTL_DSP_GETFMTS, &afmts) == -1) {
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, basedev);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue