aboutsummaryrefslogtreecommitdiff
path: root/dev/libs/pwlib/pwlib-1.10.10.diff.improved
blob: 3774ed646a446267192022309695f045d583c72c (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
--- plugins/sound_oss/sound_oss.cxx.orig	2008-03-28 20:17:52.000000000 -0300
+++ plugins/sound_oss/sound_oss.cxx	2008-03-28 21:06:13.000000000 -0300
@@ -359,7 +359,7 @@
           struct stat s;
           if (lstat(devname, &s) == 0) {
             // OSS compatible audio major device numbers (OSS, SAM9407, etc)
-            static const unsigned deviceNumbers[] = { 14, 145 };
+            static const unsigned deviceNumbers[] = { 14, 145, 246 };
             for (PINDEX i = 0; i < PARRAYSIZE(deviceNumbers); i++) {
               if ((s.st_rdev >> 8) == deviceNumbers[i]) {
                 PINDEX cardnum = (s.st_rdev >> 4) & 15;
@@ -543,16 +543,13 @@
 
     // this is the first time this device has been used
     // open the device in read/write mode always
-    // open the device in non-blocking mode to avoid hang if already open
-    os_handle = ::open((const char *)_device, O_RDWR | O_NONBLOCK);
+    // open the device without non-blocking mode, as documented in
+    // http://manuals.opensound.com/developer/open.html
+    os_handle = ::open((const char *)_device, O_RDWR);
 
     if ((os_handle < 0) && (errno != EWOULDBLOCK)) 
       return ConvertOSError(os_handle);
 
-    // switch to blocking mode
-    DWORD cmd = 0;
-    ::ioctl(os_handle, FIONBIO, &cmd);
-
     // add the device to the dictionary
     SoundHandleEntry * entry = PNEW SoundHandleEntry;
     handleDict().SetAt(_device, entry);