changeset 555:279846578fdc trunk

[svn] If we are controlling a mono mixer component, ignore balance gracefully rather than muting the audio when the slider is moved to the left.
author chainsaw
date Sat, 27 Jan 2007 16:37:02 -0800
parents 7deaaa08706a
children cd730d42b2bd
files ChangeLog src/alsa/audio.c
diffstat 2 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 27 06:48:17 2007 -0800
+++ b/ChangeLog	Sat Jan 27 16:37:02 2007 -0800
@@ -1,3 +1,11 @@
+2007-01-27 14:48:17 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1194]
+  - include a valid length
+  
+  trunk/src/scrobbler/plugin.c |    1 +
+  1 file changed, 1 insertion(+)
+
+
 2007-01-27 14:35:52 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
   revision [1192]
   - submit gerpok tracks on immediate playback begin
--- a/src/alsa/audio.c	Sat Jan 27 06:48:17 2007 -0800
+++ b/src/alsa/audio.c	Sat Jan 27 16:37:02 2007 -0800
@@ -523,10 +523,22 @@
 	if (!pcm_element)
 		return;
 
-	snd_mixer_selem_set_playback_volume(pcm_element,
-					    SND_MIXER_SCHN_FRONT_LEFT, l);
-	snd_mixer_selem_set_playback_volume(pcm_element,
-					    SND_MIXER_SCHN_FRONT_RIGHT, r);
+	if (snd_mixer_selem_is_playback_mono(pcm_element))
+	{
+		if (l > r)
+			snd_mixer_selem_set_playback_volume(pcm_element,
+							    SND_MIXER_SCHN_MONO, l);
+		else
+			snd_mixer_selem_set_playback_volume(pcm_element,
+							    SND_MIXER_SCHN_MONO, r);
+	}
+	else
+	{
+		snd_mixer_selem_set_playback_volume(pcm_element,
+						    SND_MIXER_SCHN_FRONT_LEFT, l);
+		snd_mixer_selem_set_playback_volume(pcm_element,
+						    SND_MIXER_SCHN_FRONT_RIGHT, r);
+	}
 
 	if (snd_mixer_selem_has_playback_switch(pcm_element))
 	{