decoder/thread: load APE replay gain from remote files

This commit is contained in:
Max Kellermann
2016-02-23 10:57:03 +01:00
parent 222b777552
commit 196de8c758
2 changed files with 15 additions and 0 deletions

View File

@@ -241,6 +241,18 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
decoder_stream_decode(*plugin, decoder, is);
}
/**
* Attempt to load replay gain data, and pass it to
* decoder_replay_gain().
*/
static void
LoadReplayGain(Decoder &decoder, InputStream &is)
{
ReplayGainInfo info;
if (replay_gain_ape_read(is, info))
decoder_replay_gain(decoder, &info);
}
/**
* Try decoding a stream.
*
@@ -256,6 +268,8 @@ decoder_run_stream(Decoder &decoder, const char *uri)
if (input_stream == nullptr)
return false;
LoadReplayGain(decoder, *input_stream);
const ScopeLock protect(dc.mutex);
bool tried = false;