aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/ogg_plugin.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-09 22:07:01 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-09 22:07:01 +0000
commit598db0d296a8c16e181b488040a324f9ae20cc33 (patch)
treef42184b12895cd9fad298f0db6808fa262c1e5c9 /src/inputPlugins/ogg_plugin.c
parent4abf1b7d56425be009c8d6826a753b8682bc7c22 (diff)
downloadmpd-598db0d296a8c16e181b488040a324f9ae20cc33.tar.gz
mpd-598db0d296a8c16e181b488040a324f9ae20cc33.tar.xz
mpd-598db0d296a8c16e181b488040a324f9ae20cc33.zip
work in progress
git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2566 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/ogg_plugin.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c
index d6add6d3a..b681a27e0 100644
--- a/src/inputPlugins/ogg_plugin.c
+++ b/src/inputPlugins/ogg_plugin.c
@@ -162,27 +162,27 @@ MpdTag * oggCommentsParse(char ** comments) {
while(*comments) {
if((temp = ogg_parseComment(*comments,"artist"))) {
if(!ret) ret = newMpdTag();
- if(!ret->artist) {
- ret->artist = strdup(temp);
- }
+ addItemToMpdTag(ret, TAG_ITEM_ARTIST, temp);
}
else if((temp = ogg_parseComment(*comments,"title"))) {
if(!ret) ret = newMpdTag();
- if(!ret->title) {
- ret->title = strdup(temp);
- }
+ addItemToMpdTag(ret, TAG_ITEM_TITLE, temp);
}
else if((temp = ogg_parseComment(*comments,"album"))) {
if(!ret) ret = newMpdTag();
- if(!ret->album) {
- ret->album = strdup(temp);
- }
+ addItemToMpdTag(ret, TAG_ITEM_ALBUM, temp);
}
else if((temp = ogg_parseComment(*comments,"tracknumber"))) {
if(!ret) ret = newMpdTag();
- if(!ret->track) {
- ret->track = strdup(temp);
- }
+ addItemToMpdTag(ret, TAG_ITEM_TRACK, temp);
+ }
+ else if((temp = ogg_parseComment(*comments,"genre"))) {
+ if(!ret) ret = newMpdTag();
+ addItemToMpdTag(ret, TAG_ITEM_GENRE, temp);
+ }
+ else if((temp = ogg_parseComment(*comments,"date"))) {
+ if(!ret) ret = newMpdTag();
+ addItemToMpdTag(ret, TAG_ITEM_DATE, temp);
}
comments++;
@@ -208,8 +208,8 @@ void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName,
if(tag->title) printf("Title: %s\n", tag->title);*/
if(streamName) {
- if(tag->name) free(tag->name);
- tag->name = strdup(streamName);
+ clearItemsFromMpdTag(tag, TAG_ITEM_NAME);
+ addItemToMpdTag(tag, TAG_ITEM_NAME, streamName);
}
copyMpdTagToOutputBuffer(cb, tag);