aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-11-18 22:36:58 +0100
committerMax Kellermann <max@duempel.org>2010-11-18 23:02:30 +0100
commit1ab46472ab8fa38a87f18411820bb1dbd7f51990 (patch)
tree16a4e876c9b7a610d18a7d2e73bd622b18653bbf /src/decoder_thread.c
parentf6bbe1332f63560bd212a068e8fc9faf16455dc7 (diff)
downloadmpd-1ab46472ab8fa38a87f18411820bb1dbd7f51990.tar.gz
mpd-1ab46472ab8fa38a87f18411820bb1dbd7f51990.tar.xz
mpd-1ab46472ab8fa38a87f18411820bb1dbd7f51990.zip
decoder_thread: load APE replay gain from music files
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r--src/decoder_thread.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 1a91b6566..10a796967 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -24,6 +24,7 @@
#include "decoder_list.h"
#include "decoder_plugin.h"
#include "decoder_api.h"
+#include "replay_gain_ape.h"
#include "input_stream.h"
#include "player_control.h"
#include "pipe.h"
@@ -298,6 +299,18 @@ decoder_run_stream(struct decoder *decoder, const char *uri)
}
/**
+ * Attempt to load replay gain data, and pass it to
+ * decoder_replay_gain().
+ */
+static void
+decoder_load_replay_gain(struct decoder *decoder, const char *path_fs)
+{
+ struct replay_gain_info info;
+ if (replay_gain_ape_read(path_fs, &info))
+ decoder_replay_gain(decoder, &info);
+}
+
+/**
* Try decoding a file.
*/
static bool
@@ -312,6 +325,8 @@ decoder_run_file(struct decoder *decoder, const char *path_fs)
decoder_unlock(dc);
+ decoder_load_replay_gain(decoder, path_fs);
+
while ((plugin = decoder_plugin_from_suffix(suffix, plugin)) != NULL) {
if (plugin->file_decode != NULL) {
decoder_lock(dc);