summaryrefslogtreecommitdiff
path: root/backends/oss/oss-backend.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-10-31 14:39:11 +0100
committerMichal Ratajsky <[email protected]>2014-10-31 14:39:11 +0100
commit1897445a80677ec89e7eef9f2a76e630fd088588 (patch)
tree378995fb00ace7e3f338351176433b52f6372d7e /backends/oss/oss-backend.c
parentb839e8ca0c73f9715654497e241d4aa3e3042125 (diff)
downloadlibmatemixer-1897445a80677ec89e7eef9f2a76e630fd088588.tar.bz2
libmatemixer-1897445a80677ec89e7eef9f2a76e630fd088588.tar.xz
oss: Improve *_list_streams functions and handling of device streams
Makes the functions compatible with the ALSA code. As streams in OSS are not dynamic elements, they are removed as soon as they are known to be useless.
Diffstat (limited to 'backends/oss/oss-backend.c')
-rw-r--r--backends/oss/oss-backend.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/backends/oss/oss-backend.c b/backends/oss/oss-backend.c
index 78ed69b..eb4d742 100644
--- a/backends/oss/oss-backend.c
+++ b/backends/oss/oss-backend.c
@@ -268,23 +268,23 @@ oss_backend_list_streams (MateMixerBackend *backend)
/* Walk through the list of devices and create the stream list, each
* device has at most one input and one output stream */
- list = oss->priv->devices;
+ list = g_list_last (oss->priv->devices);
while (list != NULL) {
OssDevice *device = OSS_DEVICE (list->data);
OssStream *stream;
- stream = oss_device_get_input_stream (device);
- if (stream != NULL) {
- oss->priv->streams =
- g_list_append (oss->priv->streams, g_object_ref (stream));
- }
stream = oss_device_get_output_stream (device);
- if (stream != NULL) {
+ if (stream != NULL)
oss->priv->streams =
- g_list_append (oss->priv->streams, g_object_ref (stream));
- }
- list = list->next;
+ g_list_prepend (oss->priv->streams, g_object_ref (stream));
+
+ stream = oss_device_get_input_stream (device);
+ if (stream != NULL)
+ oss->priv->streams =
+ g_list_prepend (oss->priv->streams, g_object_ref (stream));
+
+ list = list->prev;
}
}
return oss->priv->streams;