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
b6243a99
Commit
b6243a99
authored
Sep 13, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/mpcdec: merge duplicate code
parent
496f8865
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
MpcdecDecoderPlugin.cxx
src/decoder/plugins/MpcdecDecoderPlugin.cxx
+11
-4
No files found.
src/decoder/plugins/MpcdecDecoderPlugin.cxx
View file @
b6243a99
...
...
@@ -137,6 +137,15 @@ mpc_to_mpd_buffer(MpcdecSampleTraits::pointer_type dest,
*
dest
++
=
mpc_to_mpd_sample
(
*
src
++
);
}
static
constexpr
ReplayGainTuple
ImportMpcdecReplayGain
(
mpc_uint16_t
gain
,
mpc_uint16_t
peak
)
noexcept
{
auto
t
=
ReplayGainTuple
::
Undefined
();
t
.
gain
=
MPC_OLD_GAIN_REF
-
(
gain
/
256.
);
t
.
peak
=
pow
(
10
,
peak
/
256.
/
20
)
/
32767
;
return
t
;
}
static
void
mpcdec_decode
(
DecoderClient
&
client
,
InputStream
&
is
)
{
...
...
@@ -169,10 +178,8 @@ mpcdec_decode(DecoderClient &client, InputStream &is)
ReplayGainInfo
rgi
;
rgi
.
Clear
();
rgi
.
album
.
gain
=
MPC_OLD_GAIN_REF
-
(
info
.
gain_album
/
256.
);
rgi
.
album
.
peak
=
pow
(
10
,
info
.
peak_album
/
256.
/
20
)
/
32767
;
rgi
.
track
.
gain
=
MPC_OLD_GAIN_REF
-
(
info
.
gain_title
/
256.
);
rgi
.
track
.
peak
=
pow
(
10
,
info
.
peak_title
/
256.
/
20
)
/
32767
;
rgi
.
album
=
ImportMpcdecReplayGain
(
info
.
gain_album
,
info
.
peak_album
);
rgi
.
track
=
ImportMpcdecReplayGain
(
info
.
gain_title
,
info
.
peak_title
);
client
.
SubmitReplayGain
(
&
rgi
);
...
...
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