apply dottemag's id3v1 encodings patch
git-svn-id: https://svn.musicpd.org/mpd/trunk@2163 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
		| @@ -37,7 +37,7 @@ | ||||
|  | ||||
| #define CONF_COMMENT	'#' | ||||
|  | ||||
| #define CONF_NUMBER_OF_PARAMS		41 | ||||
| #define CONF_NUMBER_OF_PARAMS		42 | ||||
| #define CONF_NUMBER_OF_PATHS		6 | ||||
| #define CONF_NUMBER_OF_REQUIRED		5 | ||||
| #define CONF_NUMBER_OF_ALLOW_CATS	1 | ||||
| @@ -137,7 +137,8 @@ char ** readConf(char * file) { | ||||
| 		"shout_mount", | ||||
| 		"shout_name", | ||||
| 		"shout_user", | ||||
| 		"shout_quality" | ||||
| 		"shout_quality", | ||||
| 		"id3v1_encoding" | ||||
| 	}; | ||||
|  | ||||
| 	int conf_absolutePaths[CONF_NUMBER_OF_PATHS] = { | ||||
|   | ||||
| @@ -62,6 +62,7 @@ | ||||
| #define CONF_SHOUT_NAME				38 | ||||
| #define CONF_SHOUT_USER				39 | ||||
| #define CONF_SHOUT_QUALITY			40 | ||||
| #define CONF_ID3V1_ENCODING			41 | ||||
|  | ||||
| #define CONF_CAT_CHAR				"\n" | ||||
|  | ||||
|   | ||||
							
								
								
									
										14
									
								
								src/tag.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								src/tag.c
									
									
									
									
									
								
							| @@ -23,6 +23,8 @@ | ||||
| #include "utf8.h" | ||||
| #include "log.h" | ||||
| #include "inputStream.h" | ||||
| #include "conf.h" | ||||
| #include "charConv.h" | ||||
|  | ||||
| #include <sys/stat.h> | ||||
| #include <stdlib.h> | ||||
| @@ -91,6 +93,18 @@ char * getID3Info(struct id3_tag * tag, char * id) { | ||||
| 	utf8 = id3_ucs4_utf8duplicate(ucs4); | ||||
| 	if(!utf8) return NULL; | ||||
|  | ||||
| 	if(getConf()[CONF_ID3V1_ENCODING] | ||||
| 	  && (id3_tag_options(tag, 0, 0) & ID3_TAG_OPTION_ID3V1)) { | ||||
|  | ||||
| 		char* isostr; | ||||
| 		setCharSetConversion("ISO-8859-1", "UTF-8"); | ||||
| 		isostr = convStrDup(utf8); | ||||
| 		free(utf8); | ||||
| 		setCharSetConversion("UTF-8", getConf()[CONF_ID3V1_ENCODING]); | ||||
| 		utf8 = convStrDup(isostr); | ||||
| 		free(isostr); | ||||
| 	} | ||||
|  | ||||
| 	return utf8; | ||||
| } | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Warren Dukes
					Warren Dukes