totem-pl-parser r245 - in trunk: . plparse



Author: hadess
Date: Tue Oct 21 09:21:46 2008
New Revision: 245
URL: http://svn.gnome.org/viewvc/totem-pl-parser?rev=245&view=rev

Log:
2008-10-21  Bastien Nocera  <hadess hadess net>

	* plparse/totem-pl-parser.c (totem_pl_parser_parse_internal):
	Fix M3U file parsing, the content-type detection is unreliable
	so ignore it if it doesn't bring us anything new
	(Closes: #556060)



Modified:
   trunk/ChangeLog
   trunk/plparse/totem-pl-parser.c

Modified: trunk/plparse/totem-pl-parser.c
==============================================================================
--- trunk/plparse/totem-pl-parser.c	(original)
+++ trunk/plparse/totem-pl-parser.c	Tue Oct 21 09:21:46 2008
@@ -1467,9 +1467,15 @@
 	DEBUG(file, g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", uri, mimetype));
 	if (mimetype == NULL || strcmp (UNKNOWN_TYPE, mimetype) == 0
 	    || (g_file_is_native (file) && g_content_type_is_a (mimetype, "text/plain") != FALSE)) {
-		g_free (mimetype);
-		mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
-		DEBUG(file, g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", uri, mimetype ? mimetype : "NULL"));
+	    	char *new_mimetype;
+		new_mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
+		if (new_mimetype) {
+			g_free (mimetype);
+			mimetype = new_mimetype;
+			DEBUG(file, g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", uri, mimetype ? mimetype : "NULL"));
+		} else {
+			DEBUG(file, g_print ("_get_mime_type_with_data for '%s' returned NULL, ignoring\n", uri));
+		}
 	}
 
 	if (mimetype == NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]