Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/audio/alsa-plugins/files/patch-oss_ctl__oss.c
16462 views
1
--- oss/ctl_oss.c.orig 2024-06-10 09:18:39 UTC
2
+++ oss/ctl_oss.c
3
@@ -59,7 +59,7 @@ static const char *const vol_devices[SOUND_MIXER_NRDEV
4
[SOUND_MIXER_CD] = "CD Playback Volume",
5
[SOUND_MIXER_IMIX] = "Monitor Mix Playback Volume",
6
[SOUND_MIXER_ALTPCM] = "Headphone Playback Volume",
7
- [SOUND_MIXER_RECLEV] = "Capture Volume",
8
+ [SOUND_MIXER_RECLEV] = "Master Capture Volume",
9
[SOUND_MIXER_IGAIN] = "Capture Volume",
10
[SOUND_MIXER_OGAIN] = "Playback Volume",
11
[SOUND_MIXER_LINE1] = "Aux Playback Volume",
12
@@ -369,7 +369,9 @@ SND_CTL_PLUGIN_DEFINE_FUNC(oss)
13
{
14
snd_config_iterator_t it, next;
15
const char *device = "/dev/mixer";
16
+#ifndef __FreeBSD__
17
struct mixer_info mixinfo;
18
+#endif
19
int i, err, val;
20
snd_ctl_oss_t *oss;
21
22
@@ -406,19 +408,29 @@ SND_CTL_PLUGIN_DEFINE_FUNC(oss)
23
goto error;
24
}
25
26
+#ifndef __FreeBSD__
27
if (ioctl(oss->fd, SOUND_MIXER_INFO, &mixinfo) < 0) {
28
err = -errno;
29
SNDERR("Cannot get mixer info for device %s", device);
30
goto error;
31
}
32
+#endif
33
34
oss->ext.version = SND_CTL_EXT_VERSION;
35
oss->ext.card_idx = 0; /* FIXME */
36
+#ifdef __FreeBSD__
37
+ strncpy(oss->ext.id, "fbsd", sizeof(oss->ext.id) - 1);
38
+ strcpy(oss->ext.driver, "FreeBSD/OSS plugin");
39
+ strncpy(oss->ext.name, "FreeBSD/OSS", sizeof(oss->ext.name) - 1);
40
+ strncpy(oss->ext.longname, "FreeBSD/OSS", sizeof(oss->ext.longname) - 1);
41
+ strncpy(oss->ext.mixername, "FreeBSD/OSS", sizeof(oss->ext.mixername) - 1);
42
+#else
43
strncpy(oss->ext.id, mixinfo.id, sizeof(oss->ext.id) - 1);
44
strcpy(oss->ext.driver, "OSS-Emulation");
45
strncpy(oss->ext.name, mixinfo.name, sizeof(oss->ext.name) - 1);
46
strncpy(oss->ext.longname, mixinfo.name, sizeof(oss->ext.longname) - 1);
47
strncpy(oss->ext.mixername, mixinfo.name, sizeof(oss->ext.mixername) - 1);
48
+#endif
49
oss->ext.poll_fd = -1;
50
oss->ext.callback = &oss_ext_callback;
51
oss->ext.private_data = oss;
52
53