? gst-plugins/sys/sunaudio/gst-plugin-sunaudio-bugzilla.diff
Index: gst-plugins/ChangeLog
===================================================================
RCS file: /export/cvs/head/gstreamer/gst-plugins/ChangeLog,v
retrieving revision 1.1423
diff -p -u -5 -r1.1423 ChangeLog
--- gst-plugins/ChangeLog	2004/12/22 10:48:12	1.1423
+++ gst-plugins/ChangeLog	2004/12/22 14:30:22
@@ -1,5 +1,11 @@
+2004-12-22  Archana Shah  <archana.shah@wipro.com>
+	* sys/sunaudio/gstsunmixer.c (gst_sunaudiomixer_set_volume):
+	Normalizing the value before setting
+	(gst_sunaudiomixer_get_volume): Normalizing the value after getting.
+	Fixes bug# 161980
+
 2004-12-22  Christian Fredrik Kalager Schaller  <uraeus@gnome.org>
 
 	* Makefile.am: Make sure docs gets disted
 	* docs/Makefile.am: Make sure all needed files get disted
 	* gst-plugins.spec.in: latest updates
Index: gst-plugins/sys/sunaudio/gstsunmixer.c
===================================================================
RCS file: /export/cvs/head/gstreamer/gst-plugins/sys/sunaudio/gstsunmixer.c,v
retrieving revision 1.2
diff -p -u -5 -r1.2 gstsunmixer.c
--- gst-plugins/sys/sunaudio/gstsunmixer.c	2004/10/01 11:44:22	1.2
+++ gst-plugins/sys/sunaudio/gstsunmixer.c	2004/12/22 14:30:23
@@ -50,10 +50,11 @@ static void gst_sunaudiomixer_set_mute (
     GstMixerTrack * track, gboolean mute);
 static void gst_sunaudiomixer_set_record (GstMixer * sunaudiomixer,
     GstMixerTrack * track, gboolean record);
 
 #define MIXER_DEVICES 3
+#define SCALE_FACTOR 2.55         /* 255/100 */
 static gchar **labels = NULL;
 static GstMixerTrackClass *parent_class = NULL;
 
 GType
 gst_sunaudiomixer_track_get_type (void)
@@ -209,12 +210,13 @@ gst_sunaudiomixer_set_volume (GstMixer *
   struct audio_info audioinfo;
   GstSunAudioElement *sunaudio = GST_SUNAUDIOELEMENT (mixer);
   GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIOMIXER_TRACK (track);
 
   g_return_if_fail (sunaudio->mixer_fd != -1);
-  volume = (volumes[0] * 255) / 100;
 
+  volume = volumes[0] * SCALE_FACTOR + 0.5;
+
   /* Set the volume */
   AUDIO_INITINFO (&audioinfo);
 
   switch (sunaudiotrack->track_num) {
     case 0:
@@ -251,17 +253,17 @@ gst_sunaudiomixer_get_volume (GstMixer *
     return;
   }
 
   switch (sunaudiotrack->track_num) {
     case 0:
-      sunaudiotrack->lvol = volumes[0] = (audioinfo.play.gain * 100) / 255;
+      sunaudiotrack->lvol = volumes[0] = (audioinfo.play.gain / SCALE_FACTOR) + 0.5;
       break;
     case 1:
-      sunaudiotrack->lvol = volumes[0] = (audioinfo.record.gain * 100) / 255;
+      sunaudiotrack->lvol = volumes[0] = (audioinfo.record.gain / SCALE_FACTOR) + 0.5;
       break;
     case 2:
-      sunaudiotrack->lvol = volumes[0] = (audioinfo.monitor_gain * 100) / 255;
+      sunaudiotrack->lvol = volumes[0] = (audioinfo.monitor_gain / SCALE_FACTOR) + 0.5;
       break;
   }
 
 }
 
