After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 161980 - Volume control applet does not set value correctly.
Volume control applet does not set value correctly.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Solaris
: Normal normal
: 0.8.7
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-12-22 14:00 UTC by Archana Shah
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which fixes the bug (2.79 KB, patch)
2004-12-22 14:36 UTC, Archana Shah
none Details | Review

Description Archana Shah 2004-12-22 14:00:18 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)
Comment 1 Archana Shah 2004-12-22 14:21:01 UTC
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.
Comment 2 Archana Shah 2004-12-22 14:36:49 UTC
Created attachment 35127 [details] [review]
Patch which fixes the bug
Comment 3 Ronald Bultje 2004-12-22 14:39:27 UTC
Right, we've seen the same bug for OSS too. We'll apply this for 0.8.7 of
gst-plugins. Thanks for noticing.
Comment 4 Ronald Bultje 2004-12-22 14:49:12 UTC
Applied.