[vlc-devel] [PATCH] aout: add rounding to playlist_VolumeUp
Rémi Denis-Courmont
remi at remlab.net
Wed Mar 5 16:29:38 CET 2014
Hello,
On Tue, 4 Mar 2014 23:54:20 -0800, Alex Peak <bobcatawareness at gmail.com>
wrote:
> @@ -84,11 +88,12 @@ int playlist_VolumeUp (playlist_t *pl, int value,
> float *volp)
> float vol = aout_VolumeGet (aout);
> if (vol >= 0.)
> {
> - vol += delta / (float)AOUT_VOLUME_DEFAULT;
> + vol += delta;
> if (vol < 0.)
> vol = 0.;
> if (vol > 2.)
> vol = 2.;
> + vol = (round (vol / stepSize)) * stepSize;
Do you really need double precision round() here?
> if (volp != NULL)
> *volp = vol;
> ret = aout_VolumeSet (aout, vol);
--
Rémi Denis-Courmont
Sent from my collocated server
More information about the vlc-devel
mailing list