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
9270829b
Commit
9270829b
authored
Sep 13, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplayGainInfo: move more code to a function
parent
b6243a99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
MpcdecDecoderPlugin.cxx
src/decoder/plugins/MpcdecDecoderPlugin.cxx
+13
-6
No files found.
src/decoder/plugins/MpcdecDecoderPlugin.cxx
View file @
9270829b
...
@@ -146,6 +146,15 @@ ImportMpcdecReplayGain(mpc_uint16_t gain, mpc_uint16_t peak) noexcept
...
@@ -146,6 +146,15 @@ ImportMpcdecReplayGain(mpc_uint16_t gain, mpc_uint16_t peak) noexcept
return
t
;
return
t
;
}
}
static
constexpr
ReplayGainInfo
ImportMpcdecReplayGain
(
const
mpc_streaminfo
&
info
)
noexcept
{
auto
rgi
=
ReplayGainInfo
::
Undefined
();
rgi
.
album
=
ImportMpcdecReplayGain
(
info
.
gain_album
,
info
.
peak_album
);
rgi
.
track
=
ImportMpcdecReplayGain
(
info
.
gain_title
,
info
.
peak_title
);
return
rgi
;
}
static
void
static
void
mpcdec_decode
(
DecoderClient
&
client
,
InputStream
&
is
)
mpcdec_decode
(
DecoderClient
&
client
,
InputStream
&
is
)
{
{
...
@@ -176,12 +185,10 @@ mpcdec_decode(DecoderClient &client, InputStream &is)
...
@@ -176,12 +185,10 @@ mpcdec_decode(DecoderClient &client, InputStream &is)
mpcdec_sample_format
,
mpcdec_sample_format
,
info
.
channels
);
info
.
channels
);
ReplayGainInfo
rgi
;
{
rgi
.
Clear
();
const
auto
rgi
=
ImportMpcdecReplayGain
(
info
);
rgi
.
album
=
ImportMpcdecReplayGain
(
info
.
gain_album
,
info
.
peak_album
);
client
.
SubmitReplayGain
(
&
rgi
);
rgi
.
track
=
ImportMpcdecReplayGain
(
info
.
gain_title
,
info
.
peak_title
);
}
client
.
SubmitReplayGain
(
&
rgi
);
client
.
Ready
(
audio_format
,
is
.
IsSeekable
(),
client
.
Ready
(
audio_format
,
is
.
IsSeekable
(),
SongTime
::
FromS
(
mpc_streaminfo_get_length
(
&
info
)));
SongTime
::
FromS
(
mpc_streaminfo_get_length
(
&
info
)));
...
...
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