[gstreamer-bugs] [Bug 161980] Volume control applet does not set value correctly.

bugzilla-daemon at bugzilla.gnome.org bugzilla-daemon at bugzilla.gnome.org
Wed Dec 22 06:21:01 PST 2004

GStreamer | gst-plugins | Ver: HEAD CVS

archana.shah at wipro.com changed:

           What    |Removed                     |Added
         OS/Version|Linux                       |Solaris

------- Additional Comments From archana.shah at wipro.com  2004-12-22 09:21 -------
This problem is seen on Solaris because of the conversion done from 0-100 scale
to  0-255 scale. 

In gstsunmixer.c, We are setting the volume in function
gst_sunaudiomixer_set_volume () and getting the value in
gst_sunaudiomixer_get_volume (). 

For setting the volume, we are passing a value which we get from the slider in
the range of 0-100. So in this function, we first convert it on to the scale of
0-255 and then set it. While getting it , we get the value which is in the scale
of 0-255 so we convert it back to 0-100 scale before returning to the Volume
Control applet.

Now, the problem is that when we map value from one scale to another, we get a
fractional value due to which the value which we set and we get become
different. For example: If we set the value 65, we get only 64. If we set the
value 64, we get 63. 

Because of this value change, the slider keeps moving and finally it settles
down at the value for which we do not get fractional value during conversion.
(Due to which the value that was set and we get become same). 

Normalizing the value before setting and after getting resolves the problem.

Attaching a patch to resolve the issue.

------- You are receiving this mail because: -------
You are the assignee for the bug.
You are the QA contact for the bug.

More information about the Gstreamer-bugs mailing list