aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp3_plugin.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/inputPlugins/mp3_plugin.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 '')
-rw-r--r--src/inputPlugins/mp3_plugin.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c
index ab204ffa9..cdb2a74c0 100644
--- a/src/inputPlugins/mp3_plugin.c
+++ b/src/inputPlugins/mp3_plugin.c
@@ -549,9 +549,12 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) {
if(data->inStream->metaTitle) {
MpdTag * tag = newMpdTag();
if(data->inStream->metaName) {
- tag->name = strdup(data->inStream->metaName);
+ addItemToMpdTag(tag,
+ TAG_ITEM_NAME,
+ data->inStream->metaName);
}
- tag->title = strdup(data->inStream->metaTitle);
+ addItemToMpdTag(tag, TAG_ITEM_TITLE,
+ data->inStream->metaTitle);
free(data->inStream->metaTitle);
data->inStream->metaTitle = NULL;
copyMpdTagToOutputBuffer(cb, tag);
@@ -676,19 +679,21 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
if(inStream->metaTitle) {
if(tag) freeMpdTag(tag);
tag = newMpdTag();
- tag->title = strdup(inStream->metaTitle);
+ addItemToMpdTag(tag, TAG_ITEM_TITLE, inStream->metaTitle);
free(inStream->metaTitle);
inStream->metaTitle = NULL;
if(inStream->metaName) {
- tag->name = strdup(inStream->metaName);
+ addItemToMpdTag(tag, TAG_ITEM_NAME,
+ inStream->metaName);
}
copyMpdTagToOutputBuffer(cb, tag);
freeMpdTag(tag);
}
else if(tag) {
if(inStream->metaName) {
- if(tag->name) free(tag->name);
- tag->name = strdup(inStream->metaName);
+ clearItemsFromMpdTag(tag, TAG_ITEM_NAME);
+ addItemToMpdTag(tag, TAG_ITEM_NAME,
+ inStream->metaName);
}
copyMpdTagToOutputBuffer(cb, tag);
freeMpdTag(tag);
@@ -696,7 +701,8 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
else if(inStream->metaName) {
tag = newMpdTag();
if(inStream->metaName) {
- tag->name = strdup(inStream->metaName);
+ addItemToMpdTag(tag, TAG_ITEM_NAME,
+ inStream->metaName);
}
copyMpdTagToOutputBuffer(cb, tag);
freeMpdTag(tag);