Commit 4e089133 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

whitespace cleanup

git-svn-id: https://svn.musicpd.org/mpd/trunk@7286 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 7503518b
...@@ -142,29 +142,29 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4, ...@@ -142,29 +142,29 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
char *encoding; char *encoding;
if (type == TAG_ITEM_GENRE) if (type == TAG_ITEM_GENRE)
ucs4 = id3_genre_name(ucs4); ucs4 = id3_genre_name(ucs4);
/* use encoding field here? */ /* use encoding field here? */
if (is_id3v1 && if (is_id3v1 &&
(encoding = getConfigParamValue(CONF_ID3V1_ENCODING))) { (encoding = getConfigParamValue(CONF_ID3V1_ENCODING))) {
isostr = id3_ucs4_latin1duplicate(ucs4); isostr = id3_ucs4_latin1duplicate(ucs4);
if (mpd_unlikely(!isostr)) { if (mpd_unlikely(!isostr)) {
return NULL; return NULL;
} }
setCharSetConversion("UTF-8", encoding); setCharSetConversion("UTF-8", encoding);
utf8 = xmalloc(strlen((char *)isostr) + 1); utf8 = xmalloc(strlen((char *)isostr) + 1);
utf8 = (id3_utf8_t *)char_conv_str((char *)utf8, (char *)isostr); utf8 = (id3_utf8_t *)char_conv_str((char *)utf8, (char *)isostr);
if (!utf8) { if (!utf8) {
DEBUG("Unable to convert %s string to UTF-8: " DEBUG("Unable to convert %s string to UTF-8: "
"'%s'\n", encoding, isostr); "'%s'\n", encoding, isostr);
free(isostr); free(isostr);
return NULL; return NULL;
} }
free(isostr); free(isostr);
} else { } else {
utf8 = id3_ucs4_utf8duplicate(ucs4); utf8 = id3_ucs4_utf8duplicate(ucs4);
if (mpd_unlikely(!utf8)) { if (mpd_unlikely(!utf8)) {
return NULL; return NULL;
} }
} }
return utf8; return utf8;
} }
...@@ -206,44 +206,44 @@ static MpdTag *getID3Info( ...@@ -206,44 +206,44 @@ static MpdTag *getID3Info(
DEBUG(__FILE__": Invalid number '%i' of fields for TXX frame\n",frame->nfields); DEBUG(__FILE__": Invalid number '%i' of fields for TXX frame\n",frame->nfields);
return mpdTag; return mpdTag;
} }
field = &frame->fields[0]; field = &frame->fields[0];
/** /**
* First field is encoding field. * First field is encoding field.
* This is ignored by mpd. * This is ignored by mpd.
*/ */
if(field->type != ID3_FIELD_TYPE_TEXTENCODING) if(field->type != ID3_FIELD_TYPE_TEXTENCODING)
{ {
DEBUG(__FILE__": Expected encoding, found: %i\n",field->type); DEBUG(__FILE__": Expected encoding, found: %i\n",field->type);
} }
/* Process remaining fields, should be only one */ /* Process remaining fields, should be only one */
field = &frame->fields[1]; field = &frame->fields[1];
/* Encoding field */ /* Encoding field */
if(field->type == ID3_FIELD_TYPE_STRINGLIST) { if(field->type == ID3_FIELD_TYPE_STRINGLIST) {
/* Get the number of strings available */ /* Get the number of strings available */
nstrings = id3_field_getnstrings(field); nstrings = id3_field_getnstrings(field);
for (i = 0; i < nstrings; i++) { for (i = 0; i < nstrings; i++) {
ucs4 = id3_field_getstrings(field,i); ucs4 = id3_field_getstrings(field,i);
if(!ucs4) if(!ucs4)
continue; continue;
utf8 = processID3FieldString(isId3v1(tag),ucs4, type); utf8 = processID3FieldString(isId3v1(tag),ucs4, type);
if(!utf8) if(!utf8)
continue; continue;
if (mpdTag == NULL) if (mpdTag == NULL)
mpdTag = newMpdTag(); mpdTag = newMpdTag();
addItemToMpdTag(mpdTag, type, (char *)utf8); addItemToMpdTag(mpdTag, type, (char *)utf8);
free(utf8); free(utf8);
} }
} }
else { else {
ERROR(__FILE__": Field type not processed: %i\n",(int)id3_field_gettextencoding(field)); ERROR(__FILE__": Field type not processed: %i\n",(int)id3_field_gettextencoding(field));
} }
} }
/* A comment frame */ /* A comment frame */
else if(!strcmp(ID3_FRAME_COMMENT, id)) else if(!strcmp(ID3_FRAME_COMMENT, id))
{ {
/* A comment frame is different... */ /* A comment frame is different... */
/* 1st: encoding /* 1st: encoding
* 2nd: Language * 2nd: Language
* 3rd: String * 3rd: String
* 4th: FullString. * 4th: FullString.
...@@ -258,9 +258,9 @@ static MpdTag *getID3Info( ...@@ -258,9 +258,9 @@ static MpdTag *getID3Info(
ucs4 = id3_field_getfullstring(field); ucs4 = id3_field_getfullstring(field);
if(ucs4) if(ucs4)
{ {
utf8 = processID3FieldString(isId3v1(tag),ucs4, type); utf8 = processID3FieldString(isId3v1(tag),ucs4, type);
if(utf8) if(utf8)
{ {
if (mpdTag == NULL) if (mpdTag == NULL)
mpdTag = newMpdTag(); mpdTag = newMpdTag();
addItemToMpdTag(mpdTag, type, (char *)utf8); addItemToMpdTag(mpdTag, type, (char *)utf8);
...@@ -268,16 +268,16 @@ static MpdTag *getID3Info( ...@@ -268,16 +268,16 @@ static MpdTag *getID3Info(
} }
} }
} }
else else
{ {
DEBUG(__FILE__": 4th field in comment frame differs from expected, got '%i': ignoring\n",field->type); DEBUG(__FILE__": 4th field in comment frame differs from expected, got '%i': ignoring\n",field->type);
} }
} }
else else
{ {
DEBUG(__FILE__": Invalid 'comments' tag, got '%i' fields instead of 4\n", frame->nfields); DEBUG(__FILE__": Invalid 'comments' tag, got '%i' fields instead of 4\n", frame->nfields);
} }
} }
/* Unsupported */ /* Unsupported */
else { else {
DEBUG(__FILE__": Unsupported tag type requrested\n"); DEBUG(__FILE__": Unsupported tag type requrested\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment