changeset 1596:99962a017e0b trunk

[svn] - now xspf writes formatted xml. - strcmp is replaced with xmlStrcmp.
author yaz
date Sat, 26 Aug 2006 08:09:42 -0700
parents e6cc84e06444
children 2685ac3bd8f6
files ChangeLog Plugins/Container/xspf/xspf.c
diffstat 2 files changed, 30 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 25 01:02:18 2006 -0700
+++ b/ChangeLog	Sat Aug 26 08:09:42 2006 -0700
@@ -1,3 +1,14 @@
+2006-08-25 08:02:18 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [2113]
+  - libguess update: workaround for that g_convert can't convert properly from UCS-2BE/LE trailing after BOM. 
+  - remove "alpha test" labels from language selector for encoding detector.
+  
+
+  Changes:        Modified:
+  +3 -3           trunk/audacious/main.c  
+  +36 -10         trunk/libguess/guess.c  
+
+
 2006-08-25 06:08:22 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [2111]
   - precision in title format is regarded as character count, not byte count.
--- a/Plugins/Container/xspf/xspf.c	Fri Aug 25 01:02:18 2006 -0700
+++ b/Plugins/Container/xspf/xspf.c	Sat Aug 26 08:09:42 2006 -0700
@@ -54,7 +54,7 @@
 
 	// creator, album, title, duration, trackNum, annotation, image, 
 	for(nptr = track->children; nptr != NULL; nptr = nptr->next){
-		if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "location")){
+		if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "location")){
 			xmlChar *str = xmlNodeGetContent(nptr);
 			locale_uri = g_locale_from_utf8(str,-1,NULL,NULL,NULL);
 			if(!locale_uri){
@@ -67,21 +67,21 @@
 				tuple->file_path = g_path_get_dirname(locale_uri);
 			}
 		}
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "creator")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "creator")){
 			tuple->performer = (gchar *)xmlNodeGetContent(nptr);
 		}
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "album")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "album")){
 			tuple->album_name = (gchar *)xmlNodeGetContent(nptr);
 		}
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "title")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "title")){
 			tuple->track_name = (gchar *)xmlNodeGetContent(nptr);
 		}
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "duration")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "duration")){
 			xmlChar *str = xmlNodeGetContent(nptr);
 			tuple->length = atol(str);
 			xmlFree(str);
 		}
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "trackNum")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "trackNum")){
 			xmlChar *str = xmlNodeGetContent(nptr);
 			tuple->track_number = atol(str);
 			xmlFree(str);
@@ -92,42 +92,42 @@
 		//
 		// year, date, genre, comment, file_ext, file_path, formatter
 		//
-		else if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "meta")){
+		else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "meta")){
 			xmlChar *rel = NULL;
 			
 			rel = xmlGetProp(nptr, "rel");
 
-			if(!strcmp(rel, "year")){
+			if(!xmlStrcmp(rel, "year")){
 				xmlChar *cont = xmlNodeGetContent(nptr);
 				tuple->year = atol(cont);
 				xmlFree(cont);
 				continue;
 			}
-			else if(!strcmp(rel, "date")){
+			else if(!xmlStrcmp(rel, "date")){
 				tuple->date = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "genre")){
+			else if(!xmlStrcmp(rel, "genre")){
 				tuple->genre = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "comment")){
+			else if(!xmlStrcmp(rel, "comment")){
 				tuple->comment = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "file_ext")){
+			else if(!xmlStrcmp(rel, "file_ext")){
 				tuple->file_ext = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "file_path")){
+			else if(!xmlStrcmp(rel, "file_path")){
 				tuple->file_path = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "formatter")){
+			else if(!xmlStrcmp(rel, "formatter")){
 				tuple->formatter = (gchar *)xmlNodeGetContent(nptr);
 				continue;
 			}
-			else if(!strcmp(rel, "mtime")){
+			else if(!xmlStrcmp(rel, "mtime")){
 				xmlChar *str;
 				str = xmlNodeGetContent(nptr);
 				tuple->mtime = (time_t)atoll(str);
@@ -154,7 +154,7 @@
 {
 	xmlNode *nptr;
 	for(nptr = tracklist->children; nptr != NULL; nptr = nptr->next){
-		if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "track")){
+		if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "track")){
 			add_file(nptr, filename, pos);
 		}
 	}
@@ -174,9 +174,9 @@
 
 	// find trackList
 	for(nptr = doc->children; nptr != NULL; nptr = nptr->next) {
-		if(nptr->type == XML_ELEMENT_NODE && !strcmp(nptr->name, "playlist")){
+		if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, "playlist")){
 			for(nptr2 = nptr->children; nptr2 != NULL; nptr2 = nptr2->next){
-				if(nptr2->type == XML_ELEMENT_NODE && !strcmp(nptr2->name, "trackList")){
+				if(nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, "trackList")){
 					find_track(nptr2, filename, pos);
 				}
 			}
@@ -374,7 +374,7 @@
 		}
 	}
 
-	xmlSaveFile(filename, doc);
+	xmlSaveFormatFile(filename, doc, 1);
 	xmlFreeDoc(doc);
 }