View | Details | Raw Unified | Return to bug 245156 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (+1 lines)
Lines 6-11 Link Here
6
6
7
PORTNAME=	pulseaudio
7
PORTNAME=	pulseaudio
8
PORTVERSION=	13.0
8
PORTVERSION=	13.0
9
PORTREVISION=	1
9
CATEGORIES=	audio
10
CATEGORIES=	audio
10
MASTER_SITES=	http://freedesktop.org/software/pulseaudio/releases/
11
MASTER_SITES=	http://freedesktop.org/software/pulseaudio/releases/
11
12
(-)files/patch-src_modules_oss_oss-util.c (-1 / +52 lines)
Lines 1-7 Link Here
1
Support 24bit audio see Comment 6 of 
1
Support 24bit audio see Comment 6 of 
2
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198567
2
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198567
3
3
4
--- src/modules/oss/oss-util.c.orig	2015-09-10 04:51:41 UTC
4
--- src/modules/oss/oss-util.c.orig	2018-07-13 19:06:14 UTC
5
+++ src/modules/oss/oss-util.c
5
+++ src/modules/oss/oss-util.c
6
@@ -39,6 +39,22 @@
6
@@ -39,6 +39,22 @@
7
 
7
 
Lines 37-39 Link Here
37
         [PA_SAMPLE_S24_32LE] = AFMT_QUERY, /* not supported */
37
         [PA_SAMPLE_S24_32LE] = AFMT_QUERY, /* not supported */
38
         [PA_SAMPLE_S24_32BE] = AFMT_QUERY, /* not supported */
38
         [PA_SAMPLE_S24_32BE] = AFMT_QUERY, /* not supported */
39
     };
39
     };
40
@@ -348,7 +364,7 @@ int pa_oss_get_hw_description(const char
41
     }
42
 
43
     while (!feof(f)) {
44
-        char line[64];
45
+        char line[1024];
46
         int device;
47
 
48
         if (!fgets(line, sizeof(line), f))
49
@@ -357,14 +373,22 @@ int pa_oss_get_hw_description(const char
50
         line[strcspn(line, "\r\n")] = 0;
51
 
52
         if (!b) {
53
+#ifdef __FreeBSD__
54
+            b = pa_streq(line, "Installed devices:");
55
+#else
56
             b = pa_streq(line, "Audio devices:");
57
+#endif
58
             continue;
59
         }
60
 
61
         if (line[0] == 0)
62
             break;
63
 
64
+#ifdef __FreeBSD__
65
+        if (sscanf(line, "pcm%i: ", &device) != 1)
66
+#else
67
         if (sscanf(line, "%i: ", &device) != 1)
68
+#endif
69
             continue;
70
 
71
         if (device == n) {
72
@@ -376,7 +400,17 @@ int pa_oss_get_hw_description(const char
73
             if (pa_endswith(k, " (DUPLEX)"))
74
                 k[strlen(k)-9] = 0;
75
 
76
-            pa_strlcpy(name, k, l);
77
+            if (k[0] == '<') {
78
+                const char *e = strrchr(k, '>');
79
+
80
+                if (e) {
81
+                    const size_t q = strlen(k) - strlen(e);
82
+                    k[q] = 0;
83
+                    ++k;
84
+                }
85
+            }
86
+            // Include the number to disambiguate devices with the same name
87
+            pa_snprintf(name, l, "%d: %s", device, k);
88
             r = 0;
89
             break;
90
         }

Return to bug 245156