mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
fix module-detect on FreeBSD (patch from Diego "Flameeyes" Pettenó)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1102 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
2c2abbb169
commit
f4ec7d47fd
1 changed files with 17 additions and 11 deletions
|
|
@ -135,16 +135,14 @@ static int detect_oss(pa_core *c, int just_one) {
|
||||||
line[strcspn(line, "\r\n")] = 0;
|
line[strcspn(line, "\r\n")] = 0;
|
||||||
|
|
||||||
if (!b) {
|
if (!b) {
|
||||||
b = strcmp(line, "Audio devices:") == 0;
|
b = strcmp(line, "Audio devices:") == 0 || strcmp(line, "Installed devices:") == 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line[0] == 0)
|
if (line[0] == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (sscanf(line, "%u: ", &device) != 1)
|
if (sscanf(line, "%u: ", &device) == 1) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if (device == 0)
|
if (device == 0)
|
||||||
snprintf(args, sizeof(args), "device=/dev/dsp");
|
snprintf(args, sizeof(args), "device=/dev/dsp");
|
||||||
else
|
else
|
||||||
|
|
@ -153,6 +151,14 @@ static int detect_oss(pa_core *c, int just_one) {
|
||||||
if (!pa_module_load(c, "module-oss", args))
|
if (!pa_module_load(c, "module-oss", args))
|
||||||
continue;
|
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++;
|
n++;
|
||||||
|
|
||||||
if (just_one)
|
if (just_one)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue