summaryrefslogtreecommitdiff
path: root/devel/pwlib/patches/patch-ag
blob: ee70aa37addaa9f22ce232bbb70fdda7f0f220a9 (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
$NetBSD: patch-ag,v 1.2 2002/12/01 18:31:42 jdolecek Exp $

--- src/ptlib/unix/oss.cxx.orig	Sun Dec  1 17:31:20 2002
+++ src/ptlib/unix/oss.cxx	Sun Dec  1 17:35:35 2002
@@ -485,6 +485,7 @@
 	// there are also entries for /dev/dsp0.0 dsp0.1 dsp0.2 and dsp0.3
 	// We will ignore these N.M devices.
 
+#ifndef P_NETBSD
         // Look for dsp
         if (filename == "dsp") {
           dsp.SetAt(0, devname);
@@ -497,6 +498,20 @@
             dsp.SetAt(cardnum+1, devname);
 	  }
         }
+#else
+        // Look for dsp
+        if (filename == "audio") {
+          dsp.SetAt(0, devname);
+        }
+        // Look for audioN. Insert at position cardnum + 1
+        if ((filename.GetLength() > 5) && (filename.Left(5) == "audio")) {
+	  PString numbers = filename.Mid(3); // get everything after 'audio'
+	  if (IsNumericString(numbers)) {
+            PINDEX cardnum = numbers.AsInteger();
+            dsp.SetAt(cardnum+1, devname);
+	  }
+        }
+#endif
         // Look for mixer
         if (filename == "mixer") {
           mixer.SetAt(0, devname);
@@ -586,6 +601,8 @@
   // present, probe /dev for sound devices and return the first detected device.
   if (PFile::Exists("/dev/dsp")) {
     return "/dev/dsp";
+  } else if (PFile::Exists("/dev/audio")) {
+    return "/dev/audio";
   } else {
     // return the first dsp device detected
     PStringArray devicenames;