Serhiy Storchaka
15df36bb14
Issue #16404 : Add checks for return value of PyInt_FromLong() in
...
sys.getwindowsversion() and ossaudiodev.setparameters().
Reported by Ned Batchelder.
2013-12-17 15:09:45 +02:00
Terry Jan Reedy
ce9cc49104
Issue #17047 : remove doubled words found in 2.7 to 3.4 Modules/*,
...
as reported by Serhiy Storchaka and Matthew Barnett.
2013-03-11 17:41:44 -04:00
Charles-François Natali
564f89036f
Issue #13058 : ossaudiodev: fix a file descriptor leak on error. Patch by Thomas
...
Jarosch.
2011-09-29 19:43:01 +02:00
Charles-François Natali
fda7b379ac
Issue #12287 : Fix a stack corruption in ossaudiodev module when the FD is
...
greater than FD_SETSIZE.
2011-08-28 16:22:33 +02:00
Gregory P. Smith
dd96db63f6
This reverts r63675 based on the discussion in this thread:
...
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
2008-06-09 04:58:54 +00:00
Christian Heimes
593daf545b
Renamed PyString to PyBytes
2008-05-26 12:51:38 +00:00
Martin v. Löwis
6819210b9e
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
...
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and
PyVarObject_HEAD_INIT.
2007-07-21 06:55:02 +00:00
Armin Rigo
0d2f498a4c
Compilation problem caused by conflicting typedefs for uint32_t
...
(unsigned long vs. unsigned int).
2006-10-04 10:23:57 +00:00
Georg Brandl
96a8c3954c
Make use of METH_O and METH_NOARGS where possible.
...
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
2006-05-29 21:04:52 +00:00
Georg Brandl
5c170fd4a9
Fix some missing checks after PyTuple_New, PyList_New, PyDict_New
2006-03-17 19:03:25 +00:00
Thomas Wouters
3ffa59b137
Rework channelnumber/samplesize detetion code's output variables a bit to
...
convince gcc (4.0.x) the variables are never used uninitialized (and raising
a proper exception if they ever are.)
2006-03-01 22:45:36 +00:00
Neal Norwitz
1ac754fa10
Check return result from Py_InitModule*(). This API can fail.
...
Probably should be backported.
2006-01-19 06:09:39 +00:00
Neal Norwitz
3f0464839b
Fix icc warnings: extra semi-colon
2006-01-07 21:19:49 +00:00
Greg Ward
0f26054736
Conditionally export a few more AFMT_* macros: AFMT_U16_NE, AFMT_S32_LE,
...
AFMT_S32_BE, AFMT_MPEG.
2005-03-28 02:40:46 +00:00
Greg Ward
50682d0f78
SF #818006 : merge from release24-maint branch: add useful read-only
...
attributes to oss_audio_device object: 'closed', 'name', and 'mode'.
2005-03-07 01:41:11 +00:00
Greg Ward
fd0283eaa0
SF #832236 : merge from release23-maint branch: wrap a bunch of
...
_EXPORT_INT calls in #ifdef's, to avoid breaking the build on MkLinux
(Linux 2.0).
2004-05-11 01:34:55 +00:00
Guido van Rossum
0741f801ba
Whitespace normalization; break a long line.
2003-06-02 14:15:34 +00:00
Guido van Rossum
f39dafb10a
Fix a subtle decref bug that caused a GC assertion to fail in a debug
...
build (assert(gc->gc.gc_refs != 0) in visit_decref()).
Because OSSAudioError is a global, we must compensate (twice!) for
PyModule_AddObject()'s "helpful" decref of the object it adds.
2003-06-02 14:11:45 +00:00
Greg Ward
84f8ecd072
Comment fix.
2003-05-29 23:44:44 +00:00
Greg Ward
38c9266f42
Change _ssize() so it doesn't rely on sizeof(char) or sizeof(short):
...
8 bits is 1 byte, and that isn't about to change any time soon. (I hope!)
2003-05-29 21:55:41 +00:00
Greg Ward
d676906ab7
Completely change the interface to setparameters():
...
* it no longer takes ssize, which served no purpose apart from
scolding you if you got it wrong
* changed the order of the three remaining required arguments
to (format, channels, rate) to match the order in which they
must be set
* replaced the optional argument 'emulate' with 'strict': if strict
true, and the audio device does not accept the requested sampling
parameters, raise OSSAudioError
* return a tuple (format, channels, rate) reflecting the sampling
parameters that were actually set
Change the canonical name of ossaudiodev.error to
ossaudiodev.OSSAudioError (keep an alias for backwards compatibility).
Remove 'audio_types' list and 'n_audio_types' (no longer needed now that
setparameters() no longer has an 'ssize' argument to police).
2003-05-29 21:53:06 +00:00
Greg Ward
d0d592fd32
Oops, move the GIL release/reacquire from oss_sync() to _do_ioctl_0():
...
that way it applies to *only* the ioctl() call, and also happens for the
other blocking ioctls (POST, RESET).
2003-05-27 01:57:21 +00:00
Greg Ward
b804390ae3
Release the GIL in two more methods:
...
* sync(), because it waits for hardware buffers to flush, which
can take several seconds depending on cirumstances (according
to the OSS docs)
* close(), because it does an implicit sync()
2003-05-26 22:47:30 +00:00
Greg Ward
6492785ee5
Release the GIL around read(), write(), and select() calls.
...
Bug spotted by Joerg Lehmann <joerg@luga.de >.
2003-05-23 01:50:37 +00:00
Greg Ward
76ffb1918d
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!
2003-04-04 01:47:42 +00:00