aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-06-21 20:24:43 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-06-21 20:24:43 +0000
commit9e393393e0b5ca1b2c85664b2a5f8e36d199a269 (patch)
treea0e9a54d61ff2186bc4f93f7099e6cb2e36fd566
parente2a14f5b9e3e9846a0ba47247449dd684416da8b (diff)
downloadmpd-9e393393e0b5ca1b2c85664b2a5f8e36d199a269.tar.gz
mpd-9e393393e0b5ca1b2c85664b2a5f8e36d199a269.tar.xz
mpd-9e393393e0b5ca1b2c85664b2a5f8e36d199a269.zip
Cleanup getId3Info.
git-svn-id: https://svn.musicpd.org/mpd/trunk@4281 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/tag.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/tag.c b/src/tag.c
index 126d5bace..aaf9a2d57 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -140,24 +140,21 @@ MpdTag * getID3Info(struct id3_tag * tag, char * id, int type, MpdTag * mpdTag)
int i;
frame = id3_tag_findframe(tag, id, 0);
- if(!frame) return mpdTag;
+ if(!frame || frame->nfields < 2) return mpdTag;
field = &frame->fields[1];
nstrings = id3_field_getnstrings(field);
for(i = 0; i < nstrings; i++) {
ucs4 = id3_field_getstrings(field, i);
- assert(ucs4);
+ if(!ucs4) continue;
- if(type == TAG_ITEM_GENRE) {
- ucs4 = id3_genre_name(ucs4);
- }
+ if(type == TAG_ITEM_GENRE) ucs4 = id3_genre_name(ucs4);
utf8 = id3_ucs4_utf8duplicate(ucs4);
-
if(!utf8) continue;
- if( NULL == mpdTag ) mpdTag = newMpdTag();
+ if(mpdTag == NULL) mpdTag = newMpdTag();
addItemToMpdTag(mpdTag, type, utf8);
free(utf8);