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
d5d3b255
Commit
d5d3b255
authored
Dec 29, 2014
by
Anatoliy Anischovich
Committed by
Jean-Baptiste Kempf
Dec 29, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mpc: fix replaygain calculation (fixes #13176)
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
e5d6c04c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
modules/demux/mpc.c
modules/demux/mpc.c
+16
-4
No files found.
modules/demux/mpc.c
View file @
d5d3b255
...
...
@@ -192,21 +192,33 @@ static int Open( vlc_object_t * p_this )
fmt
.
audio
.
i_bitspersample
=
32
;
fmt
.
i_bitrate
=
fmt
.
i_bitrate
*
fmt
.
audio
.
i_channels
*
fmt
.
audio
.
i_bitspersample
;
#ifdef HAVE_MPC_MPCDEC_H
# define CONVERT_PEAK( mpc_peak ) (pow( 10, (mpc_peak) / 256.0 / 20.0 ) / 32767.0)
# define CONVERT_GAIN( mpc_gain ) (MPC_OLD_GAIN_REF - (mpc_gain) / 256.0)
#else
# define CONVERT_PEAK( mpc_peak ) ((mpc_peak) / 32767.0)
# define CONVERT_GAIN( mpc_gain ) ((mpc_gain) / 100.0)
#endif
if
(
p_sys
->
info
.
peak_title
>
0
)
{
fmt
.
audio_replay_gain
.
pb_peak
[
AUDIO_REPLAY_GAIN_TRACK
]
=
true
;
fmt
.
audio_replay_gain
.
pf_peak
[
AUDIO_REPLAY_GAIN_TRACK
]
=
(
float
)
p_sys
->
info
.
peak_title
/
32767
.
0
;
fmt
.
audio_replay_gain
.
pf_peak
[
AUDIO_REPLAY_GAIN_TRACK
]
=
(
float
)
CONVERT_PEAK
(
p_sys
->
info
.
peak_title
)
;
fmt
.
audio_replay_gain
.
pb_gain
[
AUDIO_REPLAY_GAIN_TRACK
]
=
true
;
fmt
.
audio_replay_gain
.
pf_gain
[
AUDIO_REPLAY_GAIN_TRACK
]
=
(
float
)
p_sys
->
info
.
gain_title
/
100
.
0
;
fmt
.
audio_replay_gain
.
pf_gain
[
AUDIO_REPLAY_GAIN_TRACK
]
=
(
float
)
CONVERT_GAIN
(
p_sys
->
info
.
gain_title
)
;
}
if
(
p_sys
->
info
.
peak_album
>
0
)
{
fmt
.
audio_replay_gain
.
pb_peak
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
true
;
fmt
.
audio_replay_gain
.
pf_peak
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
(
float
)
p_sys
->
info
.
peak_album
/
32767
.
0
;
fmt
.
audio_replay_gain
.
pf_peak
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
(
float
)
CONVERT_PEAK
(
p_sys
->
info
.
peak_album
)
;
fmt
.
audio_replay_gain
.
pb_gain
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
true
;
fmt
.
audio_replay_gain
.
pf_gain
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
(
float
)
p_sys
->
info
.
gain_album
/
100
.
0
;
fmt
.
audio_replay_gain
.
pf_gain
[
AUDIO_REPLAY_GAIN_ALBUM
]
=
(
float
)
CONVERT_GAIN
(
p_sys
->
info
.
gain_album
)
;
}
#undef CONVERT_GAIN
#undef CONVERT_PEAK
p_sys
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
if
(
!
p_sys
->
p_es
)
goto
error
;
...
...
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