Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
d3f19266
Commit
d3f19266
authored
Aug 09, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: use atomic variable for replay gain
parent
1252a5eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+2
-1
src/audio_output/dec.c
src/audio_output/dec.c
+2
-1
src/audio_output/input.c
src/audio_output/input.c
+10
-7
No files found.
src/audio_output/aout_internal.h
View file @
d3f19266
...
...
@@ -51,7 +51,7 @@ block_t *aout_FilterBufferNew( filter_t *, int );
/** an input stream for the audio output */
struct
aout_input_t
{
float
multiplier
;
/**< Replay gain multiplier */
vlc_atomic_t
multiplier
;
/**< Replay gain multiplier */
unsigned
samplerate
;
/**< Input sample rate */
/* pre-filters */
...
...
@@ -134,6 +134,7 @@ int aout_InputNew(audio_output_t *, const audio_sample_format_t *,
int
aout_InputDelete
(
audio_output_t
*
p_aout
,
aout_input_t
*
p_input
);
block_t
*
aout_InputPlay
(
audio_output_t
*
p_aout
,
aout_input_t
*
p_input
,
block_t
*
p_buffer
,
int
i_input_rate
,
date_t
*
);
float
aout_InputGetMultiplier
(
const
aout_input_t
*
);
/* From filters.c : */
int
aout_FiltersCreatePipeline
(
vlc_object_t
*
,
filter_t
**
,
int
*
,
...
...
src/audio_output/dec.c
View file @
d3f19266
...
...
@@ -273,7 +273,8 @@ int aout_DecPlay (audio_output_t *p_aout, block_t *p_buffer, int i_input_rate)
date_Increment
(
&
owner
->
sync
.
date
,
p_buffer
->
i_nb_samples
);
/* Mixer */
float
amp
=
owner
->
volume
.
multiplier
*
p_input
->
multiplier
;
float
amp
=
owner
->
volume
.
multiplier
*
aout_InputGetMultiplier
(
p_input
);
aout_MixerRun
(
owner
->
volume
.
mixer
,
p_buffer
,
amp
);
/* Output */
...
...
src/audio_output/input.c
View file @
d3f19266
...
...
@@ -41,9 +41,9 @@
#include <vlc_input.h>
#include <vlc_vout.h>
/* for vout_Request */
#include <vlc_modules.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
#include <vlc_atomic.h>
#include <libvlc.h>
#include "aout_internal.h"
...
...
@@ -210,8 +210,9 @@ int aout_InputNew( audio_output_t * p_aout,
}
char
*
gain
=
var_InheritString
(
p_aout
,
"audio-replay-gain-mode"
);
p_input
->
multiplier
=
ReplayGainSelect
(
VLC_OBJECT
(
p_aout
),
gain
,
&
p_input
->
replay_gain
);
vlc_atomic_setf
(
&
p_input
->
multiplier
,
ReplayGainSelect
(
VLC_OBJECT
(
p_aout
),
gain
,
&
p_input
->
replay_gain
));
free
(
gain
);
if
(
var_Type
(
p_aout
,
"audio-replay-gain-preamp"
)
==
0
)
...
...
@@ -824,17 +825,19 @@ static int EqualizerCallback (vlc_object_t *obj, char const *cmd,
return
VLC_SUCCESS
;
}
float
aout_InputGetMultiplier
(
const
aout_input_t
*
input
)
{
return
vlc_atomic_getf
(
&
input
->
multiplier
);
}
static
int
ReplayGainCallback
(
vlc_object_t
*
obj
,
char
const
*
var
,
vlc_value_t
oldval
,
vlc_value_t
val
,
void
*
data
)
{
audio_output_t
*
aout
=
(
audio_output_t
*
)
obj
;
aout_input_t
*
input
=
data
;
float
multiplier
=
ReplayGainSelect
(
obj
,
val
.
psz_string
,
&
input
->
replay_gain
);
aout_lock
(
aout
);
input
->
multiplier
=
multiplier
;
aout_unlock
(
aout
);
vlc_atomic_setf
(
&
input
->
multiplier
,
multiplier
);
VLC_UNUSED
(
var
);
VLC_UNUSED
(
oldval
);
return
VLC_SUCCESS
;
...
...
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