aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-09-25 11:39:01 +0200
committerMax Kellermann <max@duempel.org>2012-09-25 11:39:01 +0200
commite2a574e2a00803f45ed6f60154f01dd2ccc8444a (patch)
tree7bb07fc285c00d01bd0d7fb1314c49ad39cb9232 /src
parent1536b5a9d602688354648106ca8d0e34cac3c933 (diff)
parentba6ef53ef95dfd48ce0e5dd161b3199b431044ed (diff)
downloadmpd-e2a574e2a00803f45ed6f60154f01dd2ccc8444a.tar.gz
mpd-e2a574e2a00803f45ed6f60154f01dd2ccc8444a.tar.xz
mpd-e2a574e2a00803f45ed6f60154f01dd2ccc8444a.zip
Merge branch 'v0.17.x'
Conflicts: src/locate.c
Diffstat (limited to '')
-rw-r--r--src/decoder/flac_common.c5
-rw-r--r--src/decoder/mad_decoder_plugin.c5
-rw-r--r--src/decoder/wavpack_decoder_plugin.c28
-rw-r--r--src/decoder_control.c3
-rw-r--r--src/decoder_thread.c1
-rw-r--r--src/tag_ape.c2
-rw-r--r--src/tag_ape.h4
7 files changed, 21 insertions, 27 deletions
diff --git a/src/decoder/flac_common.c b/src/decoder/flac_common.c
index 510d16d59..1508ac123 100644
--- a/src/decoder/flac_common.c
+++ b/src/decoder/flac_common.c
@@ -124,11 +124,10 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
if (flac_parse_replay_gain(&rgi, block))
replay_gain_db = decoder_replay_gain(data->decoder, &rgi);
- if (flac_parse_mixramp(&mixramp_start, &mixramp_end, block)) {
- g_debug("setting mixramp_tags");
+
+ if (flac_parse_mixramp(&mixramp_start, &mixramp_end, block))
decoder_mixramp(data->decoder, replay_gain_db,
mixramp_start, mixramp_end);
- }
if (data->tag != NULL)
flac_vorbis_comments_to_tag(data->tag, NULL,
diff --git a/src/decoder/mad_decoder_plugin.c b/src/decoder/mad_decoder_plugin.c
index ec54e6633..c1a0c4b0f 100644
--- a/src/decoder/mad_decoder_plugin.c
+++ b/src/decoder/mad_decoder_plugin.c
@@ -365,11 +365,10 @@ static void mp3_parse_id3(struct mp3_data *data, size_t tagsize,
replay_gain_db = decoder_replay_gain(data->decoder, &rgi);
data->found_replay_gain = true;
}
- if (parse_id3_mixramp(&mixramp_start, &mixramp_end, id3_tag)) {
- g_debug("setting mixramp_tags");
+
+ if (parse_id3_mixramp(&mixramp_start, &mixramp_end, id3_tag))
decoder_mixramp(data->decoder, replay_gain_db,
mixramp_start, mixramp_end);
- }
}
id3_tag_delete(id3_tag);
diff --git a/src/decoder/wavpack_decoder_plugin.c b/src/decoder/wavpack_decoder_plugin.c
index ae85b0e27..9ebd0fccc 100644
--- a/src/decoder/wavpack_decoder_plugin.c
+++ b/src/decoder/wavpack_decoder_plugin.c
@@ -24,6 +24,7 @@
#include "utils.h"
#include "tag_table.h"
#include "tag_handler.h"
+#include "tag_ape.h"
#include <wavpack/wavpack.h>
#include <glib.h>
@@ -38,21 +39,6 @@
#define ERRORLEN 80
-static const struct tag_table wavpack_tags[] = {
- { "artist", TAG_ARTIST },
- { "album", TAG_ALBUM },
- { "title", TAG_TITLE },
- { "track", TAG_TRACK },
- { "name", TAG_NAME },
- { "genre", TAG_GENRE },
- { "date", TAG_DATE },
- { "composer", TAG_COMPOSER },
- { "performer", TAG_PERFORMER },
- { "comment", TAG_COMMENT },
- { "disc", TAG_DISC },
- { NULL, TAG_NUM_OF_ITEM_TYPES }
-};
-
/** A pointer type for format converter function. */
typedef void (*format_samples_t)(
int bytes_per_sample,
@@ -321,7 +307,17 @@ wavpack_scan_file(const char *fname,
WavpackGetNumSamples(wpc) /
WavpackGetSampleRate(wpc));
- for (const struct tag_table *i = wavpack_tags; i->name != NULL; ++i)
+ /* the WavPack format implies APEv2 tags, which means we can
+ reuse the mapping from tag_ape.c */
+
+ for (unsigned i = 0; i < TAG_NUM_OF_ITEM_TYPES; ++i) {
+ const char *name = tag_item_names[i];
+ if (name != NULL)
+ wavpack_scan_tag_item(wpc, name, (enum tag_type)i,
+ handler, handler_ctx);
+ }
+
+ for (const struct tag_table *i = ape_tags; i->name != NULL; ++i)
wavpack_scan_tag_item(wpc, i->name, i->type,
handler, handler_ctx);
diff --git a/src/decoder_control.c b/src/decoder_control.c
index afcb16cdf..33d4e4d44 100644
--- a/src/decoder_control.c
+++ b/src/decoder_control.c
@@ -202,7 +202,6 @@ dc_mixramp_start(struct decoder_control *dc, char *mixramp_start)
g_free(dc->mixramp_start);
dc->mixramp_start = mixramp_start;
- g_debug("mixramp_start = %s", mixramp_start ? mixramp_start : "NULL");
}
void
@@ -212,7 +211,6 @@ dc_mixramp_end(struct decoder_control *dc, char *mixramp_end)
g_free(dc->mixramp_end);
dc->mixramp_end = mixramp_end;
- g_debug("mixramp_end = %s", mixramp_end ? mixramp_end : "NULL");
}
void
@@ -222,5 +220,4 @@ dc_mixramp_prev_end(struct decoder_control *dc, char *mixramp_prev_end)
g_free(dc->mixramp_prev_end);
dc->mixramp_prev_end = mixramp_prev_end;
- g_debug("mixramp_prev_end = %s", mixramp_prev_end ? mixramp_prev_end : "NULL");
}
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 46349f53b..b13f2a46a 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -487,7 +487,6 @@ decoder_task(gpointer arg)
switch (dc->command) {
case DECODE_COMMAND_START:
- g_debug("clearing mixramp tags");
dc_mixramp_start(dc, NULL);
dc_mixramp_prev_end(dc, dc->mixramp_end);
dc->mixramp_end = NULL; /* Don't free, it's copied above. */
diff --git a/src/tag_ape.c b/src/tag_ape.c
index b941a29bc..0adc43092 100644
--- a/src/tag_ape.c
+++ b/src/tag_ape.c
@@ -24,7 +24,7 @@
#include "tag_handler.h"
#include "ape.h"
-static const struct tag_table ape_tags[] = {
+const struct tag_table ape_tags[] = {
{ "album artist", TAG_ALBUM_ARTIST },
{ "year", TAG_DATE },
{ NULL, TAG_NUM_OF_ITEM_TYPES }
diff --git a/src/tag_ape.h b/src/tag_ape.h
index 9b5856115..e2daf088d 100644
--- a/src/tag_ape.h
+++ b/src/tag_ape.h
@@ -20,10 +20,14 @@
#ifndef MPD_TAG_APE_H
#define MPD_TAG_APE_H
+#include "tag_table.h"
+
#include <stdbool.h>
struct tag_handler;
+extern const struct tag_table ape_tags[];
+
/**
* Scan the APE tags of a file.
*