changeset 3194:bbf2cd0df6c3

alsa-ng: A gint by any other name...
author John Lindgren <john.lindgren@tds.net>
date Wed, 01 Jul 2009 19:09:13 -0400
parents 93cf4d0a0dde
children 16d4308fb36e
files src/alsa-ng/alsa-core.c
diffstat 1 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/alsa-ng/alsa-core.c	Mon Jun 29 23:05:56 2009 -0400
+++ b/src/alsa-ng/alsa-core.c	Wed Jul 01 19:09:13 2009 -0400
@@ -171,25 +171,32 @@
 alsaplug_get_volume(gint *l, gint *r)
 {
     snd_mixer_elem_t *elem = alsaplug_guess_mixer_elem(amixer);
+    long left, right;
 
     if (elem == NULL)
+    {
+        * l = 50;
+        * r = 50;
         return;
+    }
 
     snd_mixer_handle_events(amixer);
 
-    *l = 0;
-    *r = 0;
-
     if (snd_mixer_selem_is_playback_mono(elem))
     {
-        snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_MONO, (glong *) l);
-        snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_MONO, (glong *) r);
+        snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_MONO, & left);
+        snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_MONO, & right);
     }
     else
     {
-        snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, (glong *) l);
-        snd_mixer_selem_get_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, (glong *) r);
+        snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_FRONT_LEFT,
+         & left);
+        snd_mixer_selem_get_playback_volume (elem, SND_MIXER_SCHN_FRONT_RIGHT,
+         & right);
     }
+
+    * l = left;
+    * r = right;
 }
 
 /********************************************************************************