Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
c45103a6
Commit
c45103a6
authored
Jul 02, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: store software amplification and mute separately
parent
5d5f1713
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+2
-1
src/audio_output/common.c
src/audio_output/common.c
+2
-1
src/audio_output/dec.c
src/audio_output/dec.c
+3
-1
src/audio_output/output.c
src/audio_output/output.c
+4
-7
No files found.
src/audio_output/aout_internal.h
View file @
c45103a6
...
...
@@ -91,7 +91,8 @@ typedef struct
struct
{
vlc_mutex_t
lock
;
float
multiplier
;
/**< Software volume amplification multiplier */
float
amp
;
/**< Software volume amplification */
bool
mute
;
/**< Software mute */
struct
audio_mixer
*
mixer
;
/**< Software volume plugin */
}
volume
;
...
...
src/audio_output/common.c
View file @
c45103a6
...
...
@@ -62,7 +62,8 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
owner
->
module
=
NULL
;
owner
->
input
=
NULL
;
vlc_mutex_init
(
&
owner
->
volume
.
lock
);
owner
->
volume
.
multiplier
=
1
.
0
;
owner
->
volume
.
amp
=
1
.
f
;
owner
->
volume
.
mute
=
false
;
owner
->
volume
.
mixer
=
NULL
;
aout
->
pf_play
=
aout_DecDeleteBuffer
;
...
...
src/audio_output/dec.c
View file @
c45103a6
...
...
@@ -310,7 +310,9 @@ int aout_DecPlay (audio_output_t *p_aout, block_t *p_buffer, int i_input_rate)
/* Mixer */
if
(
owner
->
volume
.
mixer
!=
NULL
)
{
float
amp
=
owner
->
volume
.
multiplier
float
amp
=
0
.
f
;
if
(
!
owner
->
volume
.
mute
)
amp
=
owner
->
volume
.
amp
*
vlc_atomic_getf
(
&
owner
->
gain
.
multiplier
);
aout_MixerRun
(
owner
->
volume
.
mixer
,
p_buffer
,
amp
);
}
...
...
src/audio_output/output.c
View file @
c45103a6
...
...
@@ -279,7 +279,8 @@ void aout_OutputDelete (audio_output_t *aout)
aout
->
pf_flush
=
NULL
;
aout
->
pf_volume_set
=
NULL
;
owner
->
module
=
NULL
;
owner
->
volume
.
multiplier
=
1
.
0
;
owner
->
volume
.
amp
=
1
.
f
;
owner
->
volume
.
mute
=
false
;
aout_FiltersDestroyPipeline
(
owner
->
filters
,
owner
->
nb_filters
);
}
...
...
@@ -348,12 +349,8 @@ static int aout_VolumeSoftSet (audio_output_t *aout, float volume, bool mute)
* This code is only used for the VLC software mixer. If you change this
* formula, be sure to update the aout_VolumeHardInit()-based plugins also.
*/
if
(
!
mute
)
volume
=
volume
*
volume
*
volume
;
else
volume
=
0
.;
owner
->
volume
.
multiplier
=
volume
;
owner
->
volume
.
amp
=
volume
*
volume
*
volume
;
owner
->
volume
.
mute
=
mute
;
return
0
;
}
...
...
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