aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/conf.c2
-rw-r--r--src/conf.h1
-rw-r--r--src/tag.c14
3 files changed, 17 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index db8c9f7b9..0f197dabc 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -119,6 +119,7 @@ void finishConf() {
void initConf() {
configEntriesList = makeList((ListFreeDataFunc *)freeConfigEntry, 1);
+ /* registerConfigParam(name, repeatable, block); */
registerConfigParam(CONF_PORT, 0, 0);
registerConfigParam(CONF_PID_FILE, 0, 0);
registerConfigParam(CONF_MUSIC_DIR, 0, 0);
@@ -155,6 +156,7 @@ void initConf() {
registerConfigParam(CONF_HTTP_PREBUFFER_SIZE, 0, 0);
registerConfigParam(CONF_REPLAYGAIN_PREAMP, 0, 0);
registerConfigParam(CONF_METADATA_TO_USE, 0, 0);
+ registerConfigParam(CONF_ID3V1_ENCODING, 0, 0);
}
static void addBlockParam(ConfigParam * param, char * name, char * value,
diff --git a/src/conf.h b/src/conf.h
index f5cc4bc38..864cf1f66 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -57,6 +57,7 @@
#define CONF_HTTP_BUFFER_SIZE "http_buffer_size"
#define CONF_HTTP_PREBUFFER_SIZE "http_prebuffer_size"
#define CONF_METADATA_TO_USE "metadata_to_use"
+#define CONF_ID3V1_ENCODING "id3v1_encoding"
typedef struct _BlockParam {
char * name;
diff --git a/src/tag.c b/src/tag.c
index aaf9a2d57..44a174c33 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -138,6 +138,8 @@ MpdTag * getID3Info(struct id3_tag * tag, char * id, int type, MpdTag * mpdTag)
union id3_field const * field;
unsigned int nstrings;
int i;
+ char * isostr;
+ char * encoding;
frame = id3_tag_findframe(tag, id, 0);
if(!frame || frame->nfields < 2) return mpdTag;
@@ -154,6 +156,18 @@ MpdTag * getID3Info(struct id3_tag * tag, char * id, int type, MpdTag * mpdTag)
utf8 = id3_ucs4_utf8duplicate(ucs4);
if(!utf8) continue;
+ if(isId3v1(tag)) {
+ encoding = getConfigParamValue(CONF_ID3V1_ENCODING);
+ if(encoding) {
+ setCharSetConversion("ISO-8859-1", "UTF-8");
+ isostr = convStrDup(utf8);
+ free(utf8);
+ setCharSetConversion("UTF-8", encoding);
+ utf8 = convStrDup(isostr);
+ free(isostr);
+ }
+ }
+
if(mpdTag == NULL) mpdTag = newMpdTag();
addItemToMpdTag(mpdTag, type, utf8);