[pulseaudio-commits] r1102 - /trunk/src/modules/module-detect.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Tue Jul 18 12:19:53 PDT 2006


Author: lennart
Date: Tue Jul 18 21:19:52 2006
New Revision: 1102

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1102&root=pulseaudio&view=rev
Log:
fix module-detect on FreeBSD (patch from Diego "Flameeyes" Pettenó)

Modified:
    trunk/src/modules/module-detect.c

Modified: trunk/src/modules/module-detect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-detect.c?rev=1102&root=pulseaudio&r1=1101&r2=1102&view=diff
==============================================================================
--- trunk/src/modules/module-detect.c (original)
+++ trunk/src/modules/module-detect.c Tue Jul 18 21:19:52 2006
@@ -135,23 +135,29 @@
         line[strcspn(line, "\r\n")] = 0;
 
         if (!b) {
-            b = strcmp(line, "Audio devices:") == 0;
+	     b = strcmp(line, "Audio devices:") == 0 || strcmp(line, "Installed devices:") == 0;
             continue;
         }
 
         if (line[0] == 0)
             break;
         
-        if (sscanf(line, "%u: ", &device) != 1)
-            continue;
-
-        if (device == 0)
-            snprintf(args, sizeof(args), "device=/dev/dsp");
-        else
-            snprintf(args, sizeof(args), "device=/dev/dsp%u", device);
-        
-        if (!pa_module_load(c, "module-oss", args))
-            continue;
+        if (sscanf(line, "%u: ", &device) == 1) {
+            if (device == 0)
+                snprintf(args, sizeof(args), "device=/dev/dsp");
+            else
+                snprintf(args, sizeof(args), "device=/dev/dsp%u", device);
+            
+            if (!pa_module_load(c, "module-oss", args))
+                continue;
+            
+	} else if (sscanf(line, "pcm%u: ", &device) == 1) {
+            /* FreeBSD support, the devices are named /dev/dsp0.0, dsp0.1 and so on */
+            snprintf(args, sizeof(args), "device=/dev/dsp%u.0", device);
+            
+            if (!pa_module_load(c, "module-oss", args))
+                continue;
+	}
 
         n++;
 




More information about the pulseaudio-commits mailing list