summaryrefslogtreecommitdiff
path: root/lang/python27/patches/patch-ae
blob: 23204c0123a6c94e61161a9fa7daf4bc0d2e3949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-ae,v 1.1.1.1 2011/02/22 08:52:01 obache Exp $

XXXbjs:  I use amd64, and audioop is broken on 64-bit platforms.
Thus, this needs to be tested.

--- Modules/sunaudiodev.c.orig	2010-05-09 14:46:46.000000000 +0000
+++ 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_GEBUFTINFO, &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;
     }