summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'backends/alsa/alsa-device.c')
-rw-r--r--backends/alsa/alsa-device.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/backends/alsa/alsa-device.c b/backends/alsa/alsa-device.c
index 78d8bbc..f76478f 100644
--- a/backends/alsa/alsa-device.c
+++ b/backends/alsa/alsa-device.c
@@ -459,22 +459,13 @@ static void
add_element (AlsaDevice *device, AlsaStream *stream, AlsaElement *element)
{
snd_mixer_elem_t *el;
+ gboolean add_stream = FALSE;
if (alsa_element_load (element) == FALSE)
return;
- if (alsa_stream_has_controls_or_switches (stream) == FALSE) {
- const gchar *name =
- mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream));
-
- free_stream_list (device);
-
- /* Pretend the stream has just been created now that we are adding
- * the first control */
- g_signal_emit_by_name (G_OBJECT (device),
- "stream-added",
- name);
- }
+ if (alsa_stream_has_controls_or_switches (stream) == FALSE)
+ add_stream = TRUE;
/* Add element to the stream depending on its type */
if (ALSA_IS_STREAM_CONTROL (element))
@@ -488,6 +479,19 @@ add_element (AlsaDevice *device, AlsaStream *stream, AlsaElement *element)
return;
}
+ if (add_stream == TRUE) {
+ const gchar *name =
+ mate_mixer_stream_get_name (MATE_MIXER_STREAM (stream));
+
+ free_stream_list (device);
+
+ /* Pretend the stream has just been created now that we have added
+ * the first control */
+ g_signal_emit_by_name (G_OBJECT (device),
+ "stream-added",
+ name);
+ }
+
el = alsa_element_get_snd_element (element);
/* Register to receive callbacks for element changes */