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
02b00f91
Commit
02b00f91
authored
Jul 08, 2022
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/PipeWire: don't force initial volume=100%
Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1484
parent
e807ed58
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
NEWS
NEWS
+1
-0
PipeWireOutputPlugin.cxx
src/output/plugins/PipeWireOutputPlugin.cxx
+13
-7
No files found.
NEWS
View file @
02b00f91
...
...
@@ -10,6 +10,7 @@ ver 0.23.8 (not yet released)
- alsa: fix setting volume before playback starts
- pipewire: fix crash bug
- pipewire: fix volume change events with PipeWire 0.3.53
- pipewire: don't force initial volume=100%
* support libfmt 9
ver 0.23.7 (2022/05/09)
...
...
src/output/plugins/PipeWireOutputPlugin.cxx
View file @
02b00f91
...
...
@@ -89,8 +89,12 @@ class PipeWireOutput final : AudioOutput {
/**
* The current volume level (0.0 .. 1.0).
*
* This get initialized to -1 which means "unknown", so
* restore_volume will not attempt to override PipeWire's
* initial volume level.
*/
float
volume
=
1.0
f
;
float
volume
=
-
1
;
PipeWireMixer
*
mixer
=
nullptr
;
unsigned
channels
;
...
...
@@ -669,12 +673,14 @@ PipeWireOutput::ParamChanged([[maybe_unused]] uint32_t id,
if
(
restore_volume
)
{
restore_volume
=
false
;
try
{
::
SetVolume
(
*
stream
,
channels
,
volume
);
}
catch
(...)
{
FmtError
(
pipewire_output_domain
,
FMT_STRING
(
"Failed to restore volume: {}"
),
std
::
current_exception
());
if
(
volume
>=
0
)
{
try
{
::
SetVolume
(
*
stream
,
channels
,
volume
);
}
catch
(...)
{
FmtError
(
pipewire_output_domain
,
FMT_STRING
(
"Failed to restore volume: {}"
),
std
::
current_exception
());
}
}
}
...
...
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