aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/mp4_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/mp4_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/mp4_plugin.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index 66d5600b4..a66f7d43d 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -322,6 +322,7 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
int32_t track;
int32_t time;
int32_t scale;
+ int i;
*mp4MetadataFound = 0;
@@ -359,20 +360,39 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
}
ret->time = ((float)time)/scale+0.5;
- if(!mp4ff_meta_get_artist(mp4fh,&ret->artist)) {
- *mp4MetadataFound = 1;
- }
+ for(i = 0; i < mp4ff_meta_get_num_items(mp4fh); i++) {
+ char * item;
+ char * value;
- if(!mp4ff_meta_get_album(mp4fh,&ret->album)) {
- *mp4MetadataFound = 1;
- }
+ mp4ff_meta_get_by_index(mp4fh, i, &item, &value);
- if(!mp4ff_meta_get_title(mp4fh,&ret->title)) {
- *mp4MetadataFound = 1;
- }
+ if(0 == strcasecmp("artist", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_ARTIST, value);
+ *mp4MetadataFound = 1;
+ }
+ else if(0 == strcasecmp("title", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_TITLE, value);
+ *mp4MetadataFound = 1;
+ }
+ else if(0 == strcasecmp("album", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_ALBUM, value);
+ *mp4MetadataFound = 1;
+ }
+ else if(0 == strcasecmp("track", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_TRACK, value);
+ *mp4MetadataFound = 1;
+ }
+ else if(0 == strcasecmp("genre", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_GENRE, value);
+ *mp4MetadataFound = 1;
+ }
+ else if(0 == strcasecmp("date", item)) {
+ addItemToMpdTag(ret, TAG_ITEM_DATE, value);
+ *mp4MetadataFound = 1;
+ }
- if(!mp4ff_meta_get_track(mp4fh,&ret->track)) {
- *mp4MetadataFound = 1;
+ free(item);
+ free(value);
}
mp4ff_close(mp4fh);