Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
967af603
Commit
967af603
authored
Dec 12, 2017
by
Stefano Miccoli
Committed by
Max Kellermann
Dec 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rounds alsa HW mixer volume towards ±∞ depending on sgn(∆ vol)
This alleviates a problem in which 'volume +1' cannot be undo by 'volume -1' when using alsa hw mixer. Closes #104
parent
f1ef9f9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
NEWS
NEWS
+2
-0
AlsaMixerPlugin.cxx
src/mixer/plugins/AlsaMixerPlugin.cxx
+3
-1
No files found.
NEWS
View file @
967af603
ver 0.20.13 (not yet released)
* output
- osx: set up ring buffer to hold at least 100ms
* mixer
- alsa: fix rounding errors
* database
- simple: don't purge mount points on update/rescan
- simple: fix "mount" bug caused by bad compiler optimization
...
...
src/mixer/plugins/AlsaMixerPlugin.cxx
View file @
967af603
...
...
@@ -292,7 +292,9 @@ AlsaMixer::SetVolume(unsigned volume)
{
assert
(
handle
!=
nullptr
);
int
err
=
set_normalized_playback_volume
(
elem
,
0.01
*
volume
,
1
);
double
cur
=
get_normalized_playback_volume
(
elem
,
SND_MIXER_SCHN_FRONT_LEFT
);
int
delta
=
volume
-
lrint
(
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"
,
snd_strerror
(
err
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment