pkgsrc/lang/python25/patches/patch-ae
bjs 17d4f425e1 We're not in pkgsrc-wip anymore, so replace 'wip' with 'lang' in
paths to PLIST.*. ;)

While here, patch sunaudiodev.c to use AUDIO_GETBUFINFO (when available)
and BSD AUDIO_FLUSH on NetBSD and OpenBSD.  This could be
#ifdef AUDIO_FLUSH, but for now I am only certain about these two
platforms.

Bump PKGREVISION.
2008-04-24 04:42:00 +00:00

43 lines
1.2 KiB
Text

$NetBSD: patch-ae,v 1.1 2008/04/24 04:42:00 bjs Exp $
XXXbjs: I use amd64, and audioop is broken on 64-bit platforms.
Thus, this needs to be tested.
--- Modules/sunaudiodev.c.orig 2006-01-19 01:09:39.000000000 -0500
+++ Modules/sunaudiodev.c
@@ -224,7 +224,11 @@ sad_ibufcount(sadobject *self)
{
audio_info_t ai;
+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO)
+ if (ioctl(self->x_fd, AUDIO_GETBUFINFO, &ai) < 0) {
+#else
if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}
@@ -236,7 +240,11 @@ sad_obufcount(sadobject *self)
{
audio_info_t ai;
+#if defined(__NetBSD__) && defined(AUDIO_GETBUFINFO)
+ if (ioctl(self->x_fd, AUDIO_GETBUFINFO, &ai) < 0) {
+#else
if (ioctl(self->x_fd, AUDIO_GETINFO, &ai) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}
@@ -275,7 +283,11 @@ sad_getdev(sadobject *self)
static PyObject *
sad_flush(sadobject *self)
{
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+ if (ioctl(self->x_fd, AUDIO_FLUSH, NULL) < 0) {
+#else
if (ioctl(self->x_fd, I_FLUSH, FLUSHW) < 0) {
+#endif
PyErr_SetFromErrno(SunAudioError);
return NULL;
}