aboutsummaryrefslogtreecommitdiffstats
path: root/src/metadataChunk.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-10 21:58:27 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-10 21:58:27 +0000
commitc5d27d8eaa17302b64decc502f70ab00f9a77e74 (patch)
tree88d66ab6e2edd7946e87942b7e1f8249c43ca86b /src/metadataChunk.c
parent86cf70dcb262e6637a1859893833c724149d1628 (diff)
downloadmpd-c5d27d8eaa17302b64decc502f70ab00f9a77e74.tar.gz
mpd-c5d27d8eaa17302b64decc502f70ab00f9a77e74.tar.xz
mpd-c5d27d8eaa17302b64decc502f70ab00f9a77e74.zip
merge changes from metadata-rewrite branch
git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/metadataChunk.c')
-rw-r--r--src/metadataChunk.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/metadataChunk.c b/src/metadataChunk.c
index 84817eb0e..40da4c512 100644
--- a/src/metadataChunk.c
+++ b/src/metadataChunk.c
@@ -29,9 +29,9 @@ void initMetadataChunk(MetadataChunk * chunk) {
chunk->title = -1;
}
-#define dupElementToTag(string, element) { \
+#define dupElementToTag(item, element) { \
if(element >= 0 && element < METADATA_BUFFER_LENGTH) { \
- string = strdup(chunk->buffer+element); \
+ addItemToMpdTag(ret, item, chunk->buffer+element); \
} \
}
@@ -40,10 +40,10 @@ MpdTag * metadataChunkToMpdTagDup(MetadataChunk * chunk) {
chunk->buffer[METADATA_BUFFER_LENGTH-1] = '\0';
- dupElementToTag(ret->name, chunk->name);
- dupElementToTag(ret->title, chunk->title);
- dupElementToTag(ret->artist, chunk->artist);
- dupElementToTag(ret->album, chunk->album);
+ dupElementToTag(TAG_ITEM_NAME, chunk->name);
+ dupElementToTag(TAG_ITEM_TITLE, chunk->title);
+ dupElementToTag(TAG_ITEM_ARTIST, chunk->artist);
+ dupElementToTag(TAG_ITEM_ALBUM, chunk->album);
return ret;
}
@@ -67,8 +67,16 @@ void copyMpdTagToMetadataChunk(MpdTag * tag, MetadataChunk * chunk) {
if(!tag) return;
- copyStringToChunk(tag->name, chunk->name);
- copyStringToChunk(tag->title, chunk->title);
- copyStringToChunk(tag->artist, chunk->artist);
- copyStringToChunk(tag->album, chunk->album);
+ copyStringToChunk(
+ getNextItemFromMpdTag(tag, TAG_ITEM_NAME, NULL),
+ chunk->name);
+ copyStringToChunk(
+ getNextItemFromMpdTag(tag, TAG_ITEM_TITLE, NULL),
+ chunk->title);
+ copyStringToChunk(
+ getNextItemFromMpdTag(tag, TAG_ITEM_ARTIST, NULL),
+ chunk->title);
+ copyStringToChunk(
+ getNextItemFromMpdTag(tag, TAG_ITEM_ALBUM, NULL),
+ chunk->album);
}