summaryrefslogtreecommitdiff
path: root/src/mixer
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-03-24 17:10:34 -0700
committerMax Kellermann <max@musicpd.org>2020-03-25 19:27:44 +0100
commit4fd0c84f46aa0f5dccf65c3e01ff440de08fe93b (patch)
tree29a883236bd7bef63746468f29f0ac6637a0a572 /src/mixer
parente41a52d909e8a206501fee3f2207adc9c4b9efec (diff)
replace lrint with lround
lrint is a configurable version of lround that behaves either as round, floor, ceil, or trunc based on setting the proper FE_ macro using fset/getround. Given that it's not set at all and that it defaults to round behavior, simply replace with round. Also removed the util/Math defines. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/plugins/AlsaMixerPlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mixer/plugins/AlsaMixerPlugin.cxx b/src/mixer/plugins/AlsaMixerPlugin.cxx
index 0016a4598..cce432492 100644
--- a/src/mixer/plugins/AlsaMixerPlugin.cxx
+++ b/src/mixer/plugins/AlsaMixerPlugin.cxx
@@ -273,7 +273,7 @@ AlsaMixer::GetVolume()
throw FormatRuntimeError("snd_mixer_handle_events() failed: %s",
snd_strerror(err));
- return lrint(100 * get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT));
+ return lround(100 * get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT));
}
void
@@ -282,7 +282,7 @@ AlsaMixer::SetVolume(unsigned volume)
assert(handle != nullptr);
double cur = get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT);
- int delta = volume - lrint(100.*cur);
+ int delta = volume - lround(100.*cur);
int err = set_normalized_playback_volume(elem, cur + 0.01*delta, delta);
if (err < 0)
throw FormatRuntimeError("failed to set ALSA volume: %s",