summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-11-03 14:16:07 +0100
committerMichal Ratajsky <[email protected]>2014-11-03 14:16:07 +0100
commite59883bea6be9611358e9e6aa2aa62ce08d1bb36 (patch)
treecdd5ac820fbabe852523a7199ce89eb51b28f1dd
parent720ae7991c68ccc73b9ae133194a9e99f2658b42 (diff)
downloadlibmatemixer-e59883bea6be9611358e9e6aa2aa62ce08d1bb36.tar.bz2
libmatemixer-e59883bea6be9611358e9e6aa2aa62ce08d1bb36.tar.xz
oss: Prefer custom list of OSS device directions when assigning controls to streams
-rw-r--r--backends/oss/oss-device.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/backends/oss/oss-device.c b/backends/oss/oss-device.c
index 0c5f3f3..d2e07a8 100644
--- a/backends/oss/oss-device.c
+++ b/backends/oss/oss-device.c
@@ -556,10 +556,25 @@ read_mixer_devices (OssDevice *device)
if (OSS_MASK_HAS_DEVICE (device->priv->devmask, i) == FALSE)
continue;
- if (OSS_MASK_HAS_DEVICE (device->priv->recmask, i) == TRUE)
+ /* The control is assigned to a stream according to the predefined type.
+ *
+ * OSS may allow some controls to be both input and output, but the API
+ * is too simple to tell what exactly is a control capable of. Here we
+ * simplify things a bit and assign each control to exactly one stream. */
+ switch (oss_devices[i].type) {
+ case OSS_DEV_INPUT:
stream = device->priv->input;
- else
+ break;
+ case OSS_DEV_OUTPUT:
stream = device->priv->output;
+ break;
+ case OSS_DEV_ANY:
+ if (OSS_MASK_HAS_DEVICE (device->priv->recmask, i) == TRUE)
+ stream = device->priv->input;
+ else
+ stream = device->priv->output;
+ break;
+ }
stereo = OSS_MASK_HAS_DEVICE (device->priv->stereodevs, i);
control = oss_stream_control_new (oss_devices[i].name,
@@ -603,6 +618,10 @@ read_mixer_switch (OssDevice *device)
for (i = 0; i < OSS_N_DEVICES; i++) {
OssSwitchOption *option;
+ /* Exclude output controls as this is always a recording
+ * source switch */
+ if (oss_devices[i].type == OSS_DEV_OUTPUT)
+ continue;
if (OSS_MASK_HAS_DEVICE (device->priv->devmask, i) == FALSE ||
OSS_MASK_HAS_DEVICE (device->priv->recmask, i) == FALSE)
continue;