diff options
author | Michal Ratajsky <[email protected]> | 2014-10-31 14:39:11 +0100 |
---|---|---|
committer | Michal Ratajsky <[email protected]> | 2014-10-31 14:39:11 +0100 |
commit | 1897445a80677ec89e7eef9f2a76e630fd088588 (patch) | |
tree | 378995fb00ace7e3f338351176433b52f6372d7e /backends/oss/oss-backend.c | |
parent | b839e8ca0c73f9715654497e241d4aa3e3042125 (diff) | |
download | libmatemixer-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.c | 20 |
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; |