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



Author: hadess
Date: Sun Jan 27 01:21:02 2008
New Revision: 46
URL: http://svn.gnome.org/viewvc/totem-pl-parser?rev=46&view=rev

Log:
2008-01-27  Bastien Nocera  <hadess hadess net>

	* plparse/totem-pl-parser-lines.c: (totem_pl_parser_add_ra),
	(totem_pl_parser_is_uri_list):
	* plparse/totem-pl-parser-lines.h:
	* plparse/totem-pl-parser-podcast.c: (totem_pl_parser_is_rss),
	(totem_pl_parser_is_atom), (totem_pl_parser_is_opml),
	(totem_pl_parser_is_xml_feed), (parse_rss_items),
	(totem_pl_parser_add_rss), (parse_atom_entries),
	(parse_opml_outline):
	* plparse/totem-pl-parser-podcast.h:
	* plparse/totem-pl-parser-private.h:
	* plparse/totem-pl-parser-qt.c: (totem_pl_parser_is_quicktime),
	(totem_pl_parser_add_quicktime):
	* plparse/totem-pl-parser-qt.h:
	* plparse/totem-pl-parser-wm.c: (totem_pl_parser_is_asx),
	(totem_pl_parser_is_asf), (parse_asx_entry):
	* plparse/totem-pl-parser-wm.h:
	* plparse/totem-pl-parser.c: (totem_pl_parser_set_property),
	(totem_pl_parser_get_property),
	(my_gnome_vfs_get_mime_type_with_data), (totem_pl_parser_base_url),
	(totem_pl_parser_write_buffer), (totem_pl_parser_num_entries),
	(totem_pl_parser_relative), (totem_pl_parser_write_with_title),
	(totem_pl_parser_add_url_valist), (totem_pl_parser_parse_internal),
	(totem_pl_parser_can_parse_from_data):
	Return a mime-type from the _is_ functions, and use those functions
	in my_gnome_vfs_get_mime_type_with_data to check undecided files,
	such as RSS feeds with their magic too far in the file
	(Closes: #512289)



Modified:
   trunk/ChangeLog
   trunk/plparse/totem-pl-parser-lines.c
   trunk/plparse/totem-pl-parser-lines.h
   trunk/plparse/totem-pl-parser-podcast.c
   trunk/plparse/totem-pl-parser-podcast.h
   trunk/plparse/totem-pl-parser-private.h
   trunk/plparse/totem-pl-parser-qt.c
   trunk/plparse/totem-pl-parser-qt.h
   trunk/plparse/totem-pl-parser-wm.c
   trunk/plparse/totem-pl-parser-wm.h
   trunk/plparse/totem-pl-parser.c

Modified: trunk/plparse/totem-pl-parser-lines.c
==============================================================================
--- trunk/plparse/totem-pl-parser-lines.c	(original)
+++ trunk/plparse/totem-pl-parser-lines.c	Sun Jan 27 01:21:02 2008
@@ -470,7 +470,7 @@
 totem_pl_parser_add_ra (TotemPlParser *parser, const char *url,
 			const char *base, gpointer data)
 {
-	if (data == NULL || totem_pl_parser_is_uri_list (data, strlen (data)) == FALSE) {
+	if (data == NULL || totem_pl_parser_is_uri_list (data, strlen (data)) == NULL) {
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
@@ -481,9 +481,9 @@
 
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-#define CHECK_LEN if (i >= len) { return FALSE; }
+#define CHECK_LEN if (i >= len) { return NULL; }
 
-gboolean
+const char *
 totem_pl_parser_is_uri_list (const char *data, gsize len)
 {
 	guint i = 0;
@@ -512,13 +512,13 @@
 	CHECK_LEN;
 
 	if (data[i] != '/')
-		return FALSE;
+		return NULL;
 	i++;
 	CHECK_LEN;
 
 	if (data[i] != '/')
-		return FALSE;
+		return NULL;
 
-	return TRUE;
+	return TEXT_URI_TYPE;
 }
 

Modified: trunk/plparse/totem-pl-parser-lines.h
==============================================================================
--- trunk/plparse/totem-pl-parser-lines.h	(original)
+++ trunk/plparse/totem-pl-parser-lines.h	Sun Jan 27 01:21:02 2008
@@ -31,7 +31,7 @@
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-gboolean totem_pl_parser_is_uri_list (const char *data, gsize len);
+const char * totem_pl_parser_is_uri_list (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_m3u (TotemPlParser *parser,

Modified: trunk/plparse/totem-pl-parser-podcast.c
==============================================================================
--- trunk/plparse/totem-pl-parser-podcast.c	(original)
+++ trunk/plparse/totem-pl-parser-podcast.c	Sun Jan 27 01:21:02 2008
@@ -45,7 +45,7 @@
 #define ATOM_NEEDLE "<feed "
 #define OPML_NEEDLE "<opml "
 
-gboolean
+const char *
 totem_pl_parser_is_rss (const char *data, gsize len)
 {
 	if (len == 0)
@@ -55,12 +55,12 @@
 
 	if (memmem (data, len,
 		    RSS_NEEDLE, strlen (RSS_NEEDLE)) != NULL)
-		return TRUE;
+		return RSS_MIME_TYPE;
 
-	return FALSE;
+	return NULL;
 }
 
-gboolean
+const char *
 totem_pl_parser_is_atom (const char *data, gsize len)
 {
 	if (len == 0)
@@ -70,12 +70,12 @@
 
 	if (memmem (data, len,
 		    ATOM_NEEDLE, strlen (ATOM_NEEDLE)) != NULL)
-		return TRUE;
+		return ATOM_MIME_TYPE;
 
-	return FALSE;
+	return NULL;
 }
 
-gboolean
+const char *
 totem_pl_parser_is_opml (const char *data, gsize len)
 {
 	if (len == 0)
@@ -85,21 +85,21 @@
 
 	if (memmem (data, len,
 		    OPML_NEEDLE, strlen (OPML_NEEDLE)) != NULL)
-		return TRUE;
+		return OPML_MIME_TYPE;
 
-	return FALSE;
+	return NULL;
 }
 
-gboolean
+const char *
 totem_pl_parser_is_xml_feed (const char *data, gsize len)
 {
-	if (totem_pl_parser_is_rss (data, len) != FALSE)
-		return TRUE;
-	if (totem_pl_parser_is_atom (data, len) != FALSE)
-		return TRUE;
-	if (totem_pl_parser_is_opml (data, len) != FALSE)
-		return TRUE;
-	return FALSE;
+	if (totem_pl_parser_is_rss (data, len) != NULL)
+		return RSS_MIME_TYPE;
+	if (totem_pl_parser_is_atom (data, len) != NULL)
+		return ATOM_MIME_TYPE;
+	if (totem_pl_parser_is_opml (data, len) != NULL)
+		return OPML_MIME_TYPE;
+	return NULL;
 }
 
 #ifndef TOTEM_PL_PARSER_MINI

Modified: trunk/plparse/totem-pl-parser-podcast.h
==============================================================================
--- trunk/plparse/totem-pl-parser-podcast.h	(original)
+++ trunk/plparse/totem-pl-parser-podcast.h	Sun Jan 27 01:21:02 2008
@@ -30,10 +30,10 @@
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-gboolean totem_pl_parser_is_rss (const char *data, gsize len);
-gboolean totem_pl_parser_is_atom (const char *data, gsize len);
-gboolean totem_pl_parser_is_opml (const char *data, gsize len);
-gboolean totem_pl_parser_is_xml_feed (const char *data, gsize len);
+const char * totem_pl_parser_is_rss (const char *data, gsize len);
+const char * totem_pl_parser_is_atom (const char *data, gsize len);
+const char * totem_pl_parser_is_opml (const char *data, gsize len);
+const char * totem_pl_parser_is_xml_feed (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_is_itms_feed (const char *url);

Modified: trunk/plparse/totem-pl-parser-private.h
==============================================================================
--- trunk/plparse/totem-pl-parser-private.h	(original)
+++ trunk/plparse/totem-pl-parser-private.h	Sun Jan 27 01:21:02 2008
@@ -34,6 +34,18 @@
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #define MIME_READ_CHUNK_SIZE 1024
+#define DIR_MIME_TYPE "x-directory/normal"
+#define BLOCK_DEVICE_TYPE "x-special/device-block"
+#define EMPTY_FILE_TYPE "application/x-zerosize"
+#define TEXT_URI_TYPE "text/uri-list"
+#define AUDIO_MPEG_TYPE "audio/mpeg"
+#define RSS_MIME_TYPE "application/rss+xml"
+#define ATOM_MIME_TYPE "application/atom+xml"
+#define OPML_MIME_TYPE "text/x-opml+xml"
+#define QUICKTIME_META_MIME_TYPE "application/x-quicktime-media-link"
+#define ASX_MIME_TYPE "audio/x-ms-asx"
+#define ASF_REF_MIME_TYPE "video/x-ms-asf"
+
 #define DEBUG(x) { if (parser->priv->debug) x; }
 
 struct TotemPlParserPrivate

Modified: trunk/plparse/totem-pl-parser-qt.c
==============================================================================
--- trunk/plparse/totem-pl-parser-qt.c	(original)
+++ trunk/plparse/totem-pl-parser-qt.c	Sun Jan 27 01:21:02 2008
@@ -40,7 +40,7 @@
 
 #define QT_NEEDLE "<?quicktime"
 
-gboolean
+const char *
 totem_pl_parser_is_quicktime (const char *data, gsize len)
 {
 	if (len == 0)
@@ -50,19 +50,19 @@
 
 	/* Check for RTSPtextRTSP Quicktime references */
 	if (len <= strlen ("RTSPtextRTSP://"))
-		return FALSE;
+		return NULL;
 	if (g_str_has_prefix (data, "RTSPtext") != FALSE
 			|| g_str_has_prefix (data, "rtsptext") != FALSE) {
-		return TRUE;
+		return QUICKTIME_META_MIME_TYPE;
 	}
 	if (g_str_has_prefix (data, "SMILtext") != FALSE)
-		return TRUE;
+		return QUICKTIME_META_MIME_TYPE;
 
 	if (memmem (data, len,
 		    QT_NEEDLE, strlen (QT_NEEDLE)) != NULL)
-		return TRUE;
+		return QUICKTIME_META_MIME_TYPE;
 
-	return FALSE;
+	return NULL;
 }
 
 #ifndef TOTEM_PL_PARSER_MINI
@@ -197,7 +197,7 @@
 totem_pl_parser_add_quicktime (TotemPlParser *parser, const char *url,
 			       const char *base, gpointer data)
 {
-	if (data == NULL || totem_pl_parser_is_quicktime (data, strlen (data)) == FALSE) {
+	if (data == NULL || totem_pl_parser_is_quicktime (data, strlen (data)) == NULL) {
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}

Modified: trunk/plparse/totem-pl-parser-qt.h
==============================================================================
--- trunk/plparse/totem-pl-parser-qt.h	(original)
+++ trunk/plparse/totem-pl-parser-qt.h	Sun Jan 27 01:21:02 2008
@@ -31,7 +31,7 @@
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-gboolean totem_pl_parser_is_quicktime (const char *data, gsize len);
+const char * totem_pl_parser_is_quicktime (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_quicktime (TotemPlParser *parser,

Modified: trunk/plparse/totem-pl-parser-wm.c
==============================================================================
--- trunk/plparse/totem-pl-parser-wm.c	(original)
+++ trunk/plparse/totem-pl-parser-wm.c	Sun Jan 27 01:21:02 2008
@@ -45,35 +45,35 @@
 #define ASX_NEEDLE "<ASX"
 #define ASX_NEEDLE2 "<asx"
 
-gboolean
+const char *
 totem_pl_parser_is_asx (const char *data, gsize len)
 {
 	if (len == 0)
-		return FALSE;
+		return NULL;
 
 	if (len > MIME_READ_CHUNK_SIZE)
 		len = MIME_READ_CHUNK_SIZE;
 
 	if (memmem (data, len,
 		    ASX_NEEDLE, strlen (ASX_NEEDLE)) != NULL)
-		return TRUE;
+		return ASX_MIME_TYPE;
 	if (memmem (data, len,
 		    ASX_NEEDLE2, strlen (ASX_NEEDLE2)) != NULL)
-		return TRUE;
+		return ASX_MIME_TYPE;
 
 	return FALSE;
 }
 
-gboolean
+const char *
 totem_pl_parser_is_asf (const char *data, gsize len)
 {
 	if (len == 0)
-		return FALSE;
+		return NULL;
 
 	if (g_str_has_prefix (data, "[Reference]") != FALSE
 			|| g_str_has_prefix (data, "ASF ") != FALSE
 			|| g_str_has_prefix (data, "[Address]") != FALSE) {
-		return TRUE;
+		return ASF_REF_MIME_TYPE;
 	}
 
 	return totem_pl_parser_is_asx (data, len);

Modified: trunk/plparse/totem-pl-parser-wm.h
==============================================================================
--- trunk/plparse/totem-pl-parser-wm.h	(original)
+++ trunk/plparse/totem-pl-parser-wm.h	Sun Jan 27 01:21:02 2008
@@ -31,8 +31,8 @@
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
-gboolean totem_pl_parser_is_asf (const char *data, gsize len);
-gboolean totem_pl_parser_is_asx (const char *data, gsize len);
+const char * totem_pl_parser_is_asf (const char *data, gsize len);
+const char * totem_pl_parser_is_asx (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_asf (TotemPlParser *parser,

Modified: trunk/plparse/totem-pl-parser.c
==============================================================================
--- trunk/plparse/totem-pl-parser.c	(original)
+++ trunk/plparse/totem-pl-parser.c	Sun Jan 27 01:21:02 2008
@@ -128,15 +128,10 @@
 
 #define READ_CHUNK_SIZE 8192
 #define RECURSE_LEVEL_MAX 4
-#define DIR_MIME_TYPE "x-directory/normal"
-#define BLOCK_DEVICE_TYPE "x-special/device-block"
-#define EMPTY_FILE_TYPE "application/x-zerosize"
-#define TEXT_URI_TYPE "text/uri-list"
-#define AUDIO_MPEG_TYPE "audio/mpeg"
 
 #define D(x) if (debug) x
 
-typedef gboolean (*PlaylistIdenCallback) (const char *data, gsize len);
+typedef const char * (*PlaylistIdenCallback) (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
 typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, const char *url, const char *base, gpointer data);
@@ -154,6 +149,64 @@
 } PlaylistTypes;
 
 #ifndef TOTEM_PL_PARSER_MINI
+#define PLAYLIST_TYPE(mime,cb,identcb,unsafe) { mime, cb, identcb, unsafe }
+#define PLAYLIST_TYPE2(mime,cb,identcb) { mime, cb, identcb }
+#define PLAYLIST_TYPE3(mime) { mime, NULL, NULL, FALSE }
+#else
+#define PLAYLIST_TYPE(mime,cb,identcb,unsafe) { mime }
+#define PLAYLIST_TYPE2(mime,cb,identcb) { mime, identcb }
+#define PLAYLIST_TYPE3(mime) { mime }
+#endif
+
+/* These ones need a special treatment, mostly parser formats */
+static PlaylistTypes special_types[] = {
+	PLAYLIST_TYPE ("audio/x-mpegurl", totem_pl_parser_add_m3u, NULL, FALSE),
+	PLAYLIST_TYPE ("audio/playlist", totem_pl_parser_add_m3u, NULL, FALSE),
+	PLAYLIST_TYPE ("audio/x-scpls", totem_pl_parser_add_pls, NULL, FALSE),
+	PLAYLIST_TYPE ("application/x-smil", totem_pl_parser_add_smil, NULL, FALSE),
+	PLAYLIST_TYPE ("application/smil", totem_pl_parser_add_smil, NULL, FALSE),
+	PLAYLIST_TYPE ("video/x-ms-wvx", totem_pl_parser_add_asx, NULL, FALSE),
+	PLAYLIST_TYPE ("audio/x-ms-wax", totem_pl_parser_add_asx, NULL, FALSE),
+	PLAYLIST_TYPE ("application/xspf+xml", totem_pl_parser_add_xspf, NULL, FALSE),
+	PLAYLIST_TYPE ("text/uri-list", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list, FALSE),
+	PLAYLIST_TYPE ("text/x-google-video-pointer", totem_pl_parser_add_gvp, NULL, FALSE),
+	PLAYLIST_TYPE ("text/google-video-pointer", totem_pl_parser_add_gvp, NULL, FALSE),
+	PLAYLIST_TYPE ("audio/x-iriver-pla", totem_pl_parser_add_pla, NULL, FALSE),
+	PLAYLIST_TYPE ("application/atom+xml", totem_pl_parser_add_atom, NULL, FALSE),
+	PLAYLIST_TYPE ("application/rss+xml", totem_pl_parser_add_rss, totem_pl_parser_is_rss, FALSE),
+	PLAYLIST_TYPE ("text/x-opml+xml", totem_pl_parser_add_opml, NULL, FALSE),
+#ifndef TOTEM_PL_PARSER_MINI
+	PLAYLIST_TYPE ("application/x-desktop", totem_pl_parser_add_desktop, NULL, TRUE),
+	PLAYLIST_TYPE ("application/x-gnome-app-info", totem_pl_parser_add_desktop, NULL, TRUE),
+	PLAYLIST_TYPE ("application/x-cd-image", totem_pl_parser_add_iso, NULL, TRUE),
+	PLAYLIST_TYPE ("application/x-extension-img", totem_pl_parser_add_iso, NULL, TRUE),
+	PLAYLIST_TYPE ("application/x-cue", totem_pl_parser_add_cue, NULL, TRUE),
+	PLAYLIST_TYPE (DIR_MIME_TYPE, totem_pl_parser_add_directory, NULL, TRUE),
+	PLAYLIST_TYPE (BLOCK_DEVICE_TYPE, totem_pl_parser_add_block, NULL, TRUE),
+#endif
+};
+
+/* These ones are "dual" types, might be a video, might be a parser
+ * Please keep the same _is_ functions together */
+static PlaylistTypes dual_types[] = {
+	PLAYLIST_TYPE2 ("audio/x-real-audio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("audio/x-pn-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("application/ram", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("application/vnd.rn-realmedia", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("audio/x-pn-realaudio-plugin", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("audio/vnd.rn-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("audio/x-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("text/plain", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
+	PLAYLIST_TYPE2 ("audio/x-ms-asx", totem_pl_parser_add_asx, totem_pl_parser_is_asx),
+	PLAYLIST_TYPE2 ("video/x-ms-asf", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
+	PLAYLIST_TYPE2 ("video/x-ms-wmv", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
+	PLAYLIST_TYPE2 ("video/quicktime", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
+	PLAYLIST_TYPE2 ("application/x-quicktime-media-link", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
+	PLAYLIST_TYPE2 ("application/x-quicktimeplayer", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
+	PLAYLIST_TYPE2 ("application/xml", totem_pl_parser_add_xml_feed, totem_pl_parser_is_xml_feed),
+};
+
+#ifndef TOTEM_PL_PARSER_MINI
 
 static void totem_pl_parser_set_property (GObject *object,
 					  guint prop_id,
@@ -642,10 +695,21 @@
 	mimetype = gnome_vfs_get_mime_type_for_data (*data, total_bytes_read);
 
 	if (mimetype != NULL && strcmp (mimetype, "text/plain") == 0) {
-		if (totem_pl_parser_is_uri_list (*data, total_bytes_read) != FALSE)
-			return g_strdup (TEXT_URI_TYPE);
-		else if (totem_pl_parser_is_rss (*data, total_bytes_read) != FALSE)
-			return g_strdup ("application/rss+xml");
+		PlaylistIdenCallback func;
+		guint i;
+
+		func = NULL;
+
+		for (i = 0; i < G_N_ELEMENTS(dual_types); i++) {
+			const char *res;
+
+			if (func == dual_types[i].iden)
+				continue;
+			func = dual_types[i].iden;
+			res = func (*data, total_bytes_read);
+			if (res != NULL)
+				return g_strdup (res);
+		}
 	}
 
 	return g_strdup (mimetype);
@@ -1301,67 +1365,6 @@
 	return resolved;
 }
 
-#endif /* !TOTEM_PL_PARSER_MINI */
-
-#ifndef TOTEM_PL_PARSER_MINI
-#define PLAYLIST_TYPE(mime,cb,identcb,unsafe) { mime, cb, identcb, unsafe }
-#define PLAYLIST_TYPE2(mime,cb,identcb) { mime, cb, identcb }
-#define PLAYLIST_TYPE3(mime) { mime, NULL, NULL, FALSE }
-#else
-#define PLAYLIST_TYPE(mime,cb,identcb,unsafe) { mime }
-#define PLAYLIST_TYPE2(mime,cb,identcb) { mime, identcb }
-#define PLAYLIST_TYPE3(mime) { mime }
-#endif
-
-/* These ones need a special treatment, mostly parser formats */
-static PlaylistTypes special_types[] = {
-	PLAYLIST_TYPE ("audio/x-mpegurl", totem_pl_parser_add_m3u, NULL, FALSE),
-	PLAYLIST_TYPE ("audio/playlist", totem_pl_parser_add_m3u, NULL, FALSE),
-	PLAYLIST_TYPE ("audio/x-scpls", totem_pl_parser_add_pls, NULL, FALSE),
-	PLAYLIST_TYPE ("application/x-smil", totem_pl_parser_add_smil, NULL, FALSE),
-	PLAYLIST_TYPE ("application/smil", totem_pl_parser_add_smil, NULL, FALSE),
-	PLAYLIST_TYPE ("video/x-ms-wvx", totem_pl_parser_add_asx, NULL, FALSE),
-	PLAYLIST_TYPE ("audio/x-ms-wax", totem_pl_parser_add_asx, NULL, FALSE),
-	PLAYLIST_TYPE ("application/xspf+xml", totem_pl_parser_add_xspf, NULL, FALSE),
-	PLAYLIST_TYPE ("text/uri-list", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list, FALSE),
-	PLAYLIST_TYPE ("text/x-google-video-pointer", totem_pl_parser_add_gvp, NULL, FALSE),
-	PLAYLIST_TYPE ("text/google-video-pointer", totem_pl_parser_add_gvp, NULL, FALSE),
-	PLAYLIST_TYPE ("audio/x-iriver-pla", totem_pl_parser_add_pla, NULL, FALSE),
-	PLAYLIST_TYPE ("application/atom+xml", totem_pl_parser_add_atom, NULL, FALSE),
-	PLAYLIST_TYPE ("application/rss+xml", totem_pl_parser_add_rss, totem_pl_parser_is_rss, FALSE),
-	PLAYLIST_TYPE ("text/x-opml+xml", totem_pl_parser_add_opml, NULL, FALSE),
-#ifndef TOTEM_PL_PARSER_MINI
-	PLAYLIST_TYPE ("application/x-desktop", totem_pl_parser_add_desktop, NULL, TRUE),
-	PLAYLIST_TYPE ("application/x-gnome-app-info", totem_pl_parser_add_desktop, NULL, TRUE),
-	PLAYLIST_TYPE ("application/x-cd-image", totem_pl_parser_add_iso, NULL, TRUE),
-	PLAYLIST_TYPE ("application/x-extension-img", totem_pl_parser_add_iso, NULL, TRUE),
-	PLAYLIST_TYPE ("application/x-cue", totem_pl_parser_add_cue, NULL, TRUE),
-	PLAYLIST_TYPE (DIR_MIME_TYPE, totem_pl_parser_add_directory, NULL, TRUE),
-	PLAYLIST_TYPE (BLOCK_DEVICE_TYPE, totem_pl_parser_add_block, NULL, TRUE),
-#endif
-};
-
-/* These ones are "dual" types, might be a video, might be a parser */
-static PlaylistTypes dual_types[] = {
-	PLAYLIST_TYPE2 ("audio/x-real-audio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("audio/x-pn-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("application/ram", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("application/vnd.rn-realmedia", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("audio/x-pn-realaudio-plugin", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("audio/vnd.rn-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("audio/x-realaudio", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("text/plain", totem_pl_parser_add_ra, totem_pl_parser_is_uri_list),
-	PLAYLIST_TYPE2 ("audio/x-ms-asx", totem_pl_parser_add_asx, totem_pl_parser_is_asx),
-	PLAYLIST_TYPE2 ("video/x-ms-asf", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
-	PLAYLIST_TYPE2 ("video/x-ms-wmv", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
-	PLAYLIST_TYPE2 ("video/quicktime", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
-	PLAYLIST_TYPE2 ("application/x-quicktime-media-link", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
-	PLAYLIST_TYPE2 ("application/x-quicktimeplayer", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
-	PLAYLIST_TYPE2 ("application/xml", totem_pl_parser_add_xml_feed, totem_pl_parser_is_xml_feed),
-};
-
-#ifndef TOTEM_PL_PARSER_MINI
-
 static PlaylistTypes ignore_types[] = {
 	PLAYLIST_TYPE3 ("image/*"),
 	PLAYLIST_TYPE3 ("text/plain"),
@@ -1853,7 +1856,7 @@
 		if (strcmp (dual_types[i].mimetype, mimetype) == 0) {
 			D(g_message ("Should be dual type '%s', making sure now", mimetype));
 			if (dual_types[i].iden != NULL) {
-				gboolean retval = (* dual_types[i].iden) (data, len);
+				gboolean retval = ((* dual_types[i].iden) (data, len) != NULL);
 				D(g_message ("%s dual type '%s'",
 							retval ? "Is" : "Is not", mimetype));
 				return retval;



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