Add back the id3v1_encoding option. Now it really will convert id3v1 only.
git-svn-id: https://svn.musicpd.org/mpd/trunk@4282 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
9e393393e0
commit
18306dfbd3
@ -200,6 +200,10 @@ pid_file "~/.mpd/mpd.pid"
|
||||
#
|
||||
#port "6600"
|
||||
#
|
||||
# This determines what encoding ID3v1 tags should be converted from.
|
||||
#
|
||||
#id3v1_encoding "ISO-8859-1"
|
||||
#
|
||||
# This sets the metadata mpd will use, to disable all metadata, set to "none"
|
||||
# NOTE: comments are disabled by default
|
||||
#
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
14
src/tag.c
14
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user