Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
4f5e7f1b
Commit
4f5e7f1b
authored
Feb 23, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PulseAudio: fix setting volume without stream in most cases
parent
dd007b12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+21
-6
No files found.
modules/audio_output/pulse.c
View file @
4f5e7f1b
...
...
@@ -619,6 +619,7 @@ static int VolumeSet(audio_output_t *aout, float vol)
pa_stream
*
s
=
sys
->
stream
;
pa_operation
*
op
;
int
ret
=
-
1
;
pa_volume_t
base_volume
;
/* VLC provides the software volume so convert directly to PulseAudio
* software volume, pa_volume_t. This is not a linear amplification factor
...
...
@@ -629,18 +630,32 @@ static int VolumeSet(audio_output_t *aout, float vol)
pa_threaded_mainloop_lock
(
sys
->
mainloop
);
if
(
!
PA_VOLUME_IS_VALID
(
sys
->
base_volume
))
{
msg_Err
(
aout
,
"cannot change volume without base"
);
goto
out
;
base_volume
=
sys
->
base_volume
;
if
(
!
PA_VOLUME_IS_VALID
(
base_volume
))
{
/* Base volume is unknown, typically because sink is unknown.
* Try to guess the base volume. */
const
struct
sink
*
sink
=
sys
->
sinks
;
if
(
unlikely
(
sink
==
NULL
))
{
msg_Err
(
aout
,
"cannot change volume without sink"
);
goto
out
;
}
base_volume
=
sink
->
base_volume
;
while
((
sink
=
sink
->
next
)
!=
NULL
)
if
(
sink
->
base_volume
!=
base_volume
)
{
msg_Err
(
aout
,
"cannot change volume without base"
);
goto
out
;
}
}
pa_volume_t
volume
=
pa_sw_volume_multiply
(
lroundf
(
vol
),
sys
->
base_volume
);
pa_volume_t
volume
=
pa_sw_volume_multiply
(
lroundf
(
vol
),
base_volume
);
if
(
s
==
NULL
)
{
sys
->
volume_force
=
volume
;
aout_VolumeReport
(
aout
,
vol
ume
/
PA_VOLUME_NORM
);
aout_VolumeReport
(
aout
,
vol
/
(
float
)
PA_VOLUME_NORM
);
ret
=
0
;
goto
out
;
}
...
...
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