mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04: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,23 +135,29 @@ static int detect_oss(pa_core *c, int just_one) {
|
|||
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++;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue