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
86e8b8c1
Commit
86e8b8c1
authored
Nov 25, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: skip the ReplayGain loader if the feature is disabled
https://bugs.musicpd.org/view.php?id=4595
parent
ee57c349
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+19
-2
No files found.
src/decoder/DecoderThread.cxx
View file @
86e8b8c1
...
...
@@ -257,6 +257,23 @@ LoadReplayGain(DecoderClient &client, InputStream &is)
}
/**
* Call LoadReplayGain() unless ReplayGain is disabled. This saves
* the I/O overhead when the user is not interested in the feature.
*/
static
void
MaybeLoadReplayGain
(
DecoderBridge
&
bridge
,
InputStream
&
is
)
{
{
const
ScopeLock
protect
(
bridge
.
dc
.
mutex
);
if
(
bridge
.
dc
.
replay_gain_mode
==
ReplayGainMode
::
OFF
)
/* ReplayGain is disabled */
return
;
}
LoadReplayGain
(
bridge
,
is
);
}
/**
* Try decoding a stream.
*
* DecoderControl::mutex is not locked by caller.
...
...
@@ -269,7 +286,7 @@ decoder_run_stream(DecoderBridge &bridge, const char *uri)
auto
input_stream
=
decoder_input_stream_open
(
dc
,
uri
);
assert
(
input_stream
);
LoadReplayGain
(
bridge
,
*
input_stream
);
Maybe
LoadReplayGain
(
bridge
,
*
input_stream
);
const
ScopeLock
protect
(
dc
.
mutex
);
...
...
@@ -376,7 +393,7 @@ decoder_run_file(DecoderBridge &bridge, const char *uri_utf8, Path path_fs)
assert
(
input_stream
);
LoadReplayGain
(
bridge
,
*
input_stream
);
Maybe
LoadReplayGain
(
bridge
,
*
input_stream
);
auto
&
is
=
*
input_stream
;
return
decoder_plugins_try
([
&
bridge
,
path_fs
,
suffix
,
...
...
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