GNOME Bugzilla – Bug 161980
Volume control applet does not set value correctly.
Last modified: 2004-12-22 21:47:04 UTC
Steps to reproduce: 1. Add Volume Control applet to the panel (Add to Panel->MultiMedia->Volume Control applet) 2. Focus Volume Control applet. 3. Press Space to display control. 4. Try adjusting volume level on the slider. (Use +/- keys or Arrow key or mouse) The slider value keeps changing automatically after leaving it and then gets adjusted at some volume level. (Which is different then what was set)
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.
Created attachment 35127 [details] [review] Patch which fixes the bug
Right, we've seen the same bug for OSS too. We'll apply this for 0.8.7 of gst-plugins. Thanks for noticing.
Applied.