Index: configure.in
===================================================================
--- configure.in	(revision 42)
+++ configure.in	(working copy)
@@ -77,7 +77,7 @@
 AM_CONDITIONAL(HAVE_HAL, test x"$with_hal" = xyes)
 
 dnl Check for packages for building libtotem-plparser.la
-PKG_CHECK_MODULES(TOTEM_PLPARSER, [glib-2.0 >= $GLIB_REQS gtk+-2.0 libxml-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 camel-1.2])
+PKG_CHECK_MODULES(TOTEM_PLPARSER, [glib-2.0 >= $GLIB_REQS gtk+-2.0 libxml-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 camel-1.2 gio-2.0])
 
 PKG_CHECK_MODULES([TOTEM_PLPARSER_MINI], [gnome-vfs-2.0 gnome-vfs-module-2.0])
 
Index: plparse/totem-pl-parser-pla.c
===================================================================
--- plparse/totem-pl-parser-pla.c	(revision 41)
+++ plparse/totem-pl-parser-pla.c	(working copy)
@@ -159,9 +159,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pla (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_pla (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, *title;
 	int size, offset, max_entries, entry;
@@ -243,6 +246,7 @@
 	g_free (contents);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-private.h
===================================================================
--- plparse/totem-pl-parser-private.h	(revision 46)
+++ plparse/totem-pl-parser-private.h	(working copy)
@@ -29,6 +29,8 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
 #include <glib-object.h>
+#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -88,8 +90,8 @@
 char * totem_pl_parser_relative			(const char *url,
 						 const char *output);
 TotemPlParserResult totem_pl_parser_parse_internal (TotemPlParser *parser,
-						    const char *url,
-						    const char *base);
+						    GFile *file,
+						    GFile *base_file);
 void totem_pl_parser_add_one_url		(TotemPlParser *parser,
 						 const char *url,
 						 const char *title);
Index: plparse/totem-disc.c
===================================================================
--- plparse/totem-disc.c	(revision 41)
+++ plparse/totem-disc.c	(working copy)
@@ -49,7 +49,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 
 #ifdef HAVE_HAL
 #include <libhal.h>
@@ -61,7 +61,7 @@
 typedef struct _CdCache {
   /* device node and mountpoint */
   char *device, *mountpoint;
-  GnomeVFSDrive *drive;
+  GDrive *drive;
 
 #ifdef HAVE_HAL
   LibHalContext *ctx;
@@ -111,11 +111,12 @@
 }
 
 static gboolean
-cd_cache_get_dev_from_volumes (GnomeVFSVolumeMonitor *mon, const char *device,
+cd_cache_get_dev_from_volumes (GVolumeMonitor *mon,
+			       const char *device,
 			      char **mountpoint)
 {
   gboolean found;
-  GnomeVFSVolume *volume = NULL;
+  GVolume *volume = NULL;
   GList *list, *or;
 
   found = FALSE;
Index: plparse/totem-pl-parser-media.c
===================================================================
--- plparse/totem-pl-parser-media.c	(revision 41)
+++ plparse/totem-pl-parser-media.c	(working copy)
@@ -40,8 +40,10 @@
 /* Returns NULL if we don't have an ISO image,
  * or an empty string if it's non-UTF-8 data */
 static char *
-totem_pl_parser_iso_get_title (const char *url)
+totem_pl_parser_iso_get_title (GFile *file)
 {
+	//FIXME
+#if 0
 	char *fname;
 	FILE  *file;
 #define BUFFER_SIZE 128
@@ -107,20 +109,25 @@
 	}
 
 	return str;
+#endif
+	return NULL;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_iso (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_iso (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
-	GnomeVFSFileInfo *info;
+	GFileInfo *info;
+//	GnomeVFSFileInfo *info;
 	char *item, *label;
 
 	/* This is a hack, it could be a VCD or DVD */
-	if (g_str_has_prefix (url, "file://") == FALSE)
+	if (g_file_has_uri_scheme (file, "file") == FALSE)
 		return TOTEM_PL_PARSER_RESULT_IGNORED;
 
-	label = totem_pl_parser_iso_get_title (url);
+	label = totem_pl_parser_iso_get_title (file);
 	if (label == NULL) {
 		/* Not an ISO image */
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
@@ -130,32 +137,36 @@
 		label = NULL;
 	}
 
-	info = gnome_vfs_file_info_new ();
-	if (gnome_vfs_get_file_info (url, info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) != GNOME_VFS_OK) {
-		gnome_vfs_file_info_unref (info);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (info == NULL) {
+		g_free (label);
 		return TOTEM_PL_PARSER_RESULT_IGNORED;
 	}
 
+#if 0
 	/* Less than 700 megs, and it's a VCD */
-	if (info->size < 700 * 1024 * 1024) {
+	if (g_file_info_get_size (info) < 700 * 1024 * 1024) {
 		item = totem_cd_mrl_from_type ("vcd", url);
 	} else {
 		item = totem_cd_mrl_from_type ("dvd", url);
 	}
-
-	gnome_vfs_file_info_unref (info);
-
+#endif
+	g_object_unref (info);
+#if 0
 	totem_pl_parser_add_one_url (parser, item, label);
+#endif
 	g_free (label);
-	g_free (item);
+//	g_free (item);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_cue (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_cue (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file, gpointer data)
 {
+#if 0
 	char *vcdurl;
 
 	vcdurl = totem_cd_mrl_from_type ("vcd", url);
@@ -163,6 +174,7 @@
 	g_free (vcdurl);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 static int
@@ -182,9 +194,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_directory (TotemPlParser *parser, const char *url,
-			       const char *base, gpointer data)
+totem_pl_parser_add_directory (TotemPlParser *parser,
+			       GFile *file,
+			       GFile *base_file,
+			       gpointer data)
 {
+#if 0
 	TotemDiscMediaType type;
 	GList *list, *l;
 	GnomeVFSResult res;
@@ -241,12 +256,16 @@
 	g_list_free (list);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_block (TotemPlParser *parser, const char *url,
-			   const char *base, gpointer data)
+totem_pl_parser_add_block (TotemPlParser *parser,
+			   GFile *file,
+			   GFile *base_file,
+			   gpointer data)
 {
+#if 0
 	TotemDiscMediaType type;
 	char *media_url;
 	GError *err = NULL;
@@ -264,6 +283,7 @@
 	totem_pl_parser_add_one_url (parser, media_url, NULL);
 	g_free (media_url);
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/test-parser.c
===================================================================
--- plparse/test-parser.c	(revision 41)
+++ plparse/test-parser.c	(working copy)
@@ -3,11 +3,12 @@
 #include <locale.h>
 
 #include <glib.h>
+#include <gio/gio.h>
+
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <time.h>
-#include <libgnomevfs/gnome-vfs.h>
 
 #include "totem-pl-parser.h"
 #include "totem-pl-parser-mini.h"
@@ -293,62 +294,43 @@
 static char *
 test_data_get_data (const char *uri, guint *len)
 {
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
+	gssize bytes_read;
+	GFileInputStream *stream;
+	GFile *file;
+	GError *error = NULL;
 	char *buffer;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
 
 	*len = 0;
 
+	file = g_file_new_for_uri (uri);
+
 	/* Open the file. */
-	result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
-	if (result != GNOME_VFS_OK)
+	stream = g_file_read (file, NULL, &error);
+	if (stream == NULL) {
+		g_print ("URL '%s' couldn't be opened in test_data_get_data: '%s'\n", uri, error->message);
+		g_error_free (error);
 		return NULL;
+	}
 
-	/* Read the whole thing, up to MIME_READ_CHUNK_SIZE */
-	buffer = NULL;
-	total_bytes_read = 0;
-	do {
-		buffer = g_realloc (buffer, total_bytes_read
-				+ MIME_READ_CHUNK_SIZE);
-		result = gnome_vfs_read (handle,
-				buffer + total_bytes_read,
-				MIME_READ_CHUNK_SIZE,
-				&bytes_read);
-		if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
+	buffer = g_malloc (MIME_READ_CHUNK_SIZE);
+	bytes_read = g_input_stream_read (G_INPUT_STREAM (stream), buffer, MIME_READ_CHUNK_SIZE, NULL, &error);
+	g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL);
+	if (bytes_read == -1) {
+		g_free (buffer);
+		return NULL;
+	}
 
-		/* Check for overflow. */
-		if (total_bytes_read + bytes_read < total_bytes_read) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		total_bytes_read += bytes_read;
-	} while (result == GNOME_VFS_OK
-			&& total_bytes_read < MIME_READ_CHUNK_SIZE);
-
-	/* Close the file but don't overwrite the possible error */
-	if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF)
-		gnome_vfs_close (handle);
-	else
-		result = gnome_vfs_close (handle);
-
-	if (result != GNOME_VFS_OK) {
-		g_message ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result));
+	if (bytes_read == -1) {
+		g_message ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, error->message);
+		g_error_free (error);
 		g_free (buffer);
 		return NULL;
 	}
 
 	/* Return the file null-terminated. */
-	buffer = g_realloc (buffer, total_bytes_read + 1);
-	buffer[total_bytes_read] = '\0';
-	*len = total_bytes_read;
+	buffer = g_realloc (buffer, bytes_read + 1);
+	buffer[bytes_read] = '\0';
+	*len = bytes_read;
 
 	return buffer;
 }
@@ -457,8 +439,6 @@
 		exit (1);
 	}
 
-	gnome_vfs_init();
-
 	if (g_fatal_warnings) {
 		GLogLevelFlags fatal_mask;
 
Index: plparse/totem-pl-parser-pla.h
===================================================================
--- plparse/totem-pl-parser-pla.h	(revision 41)
+++ plparse/totem-pl-parser-pla.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_pla				(TotemPlParser *parser,
@@ -38,8 +39,8 @@
 								 gpointer user_data,
 								 GError **error);
 TotemPlParserResult totem_pl_parser_add_pla			(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-media.h
===================================================================
--- plparse/totem-pl-parser-media.h	(revision 41)
+++ plparse/totem-pl-parser-media.h	(working copy)
@@ -27,24 +27,25 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_iso (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_cue (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_directory (TotemPlParser *parser,
-						   const char *url,
-						   const char *base,
+						   GFile *file,
+						   GFile *base_file,
 						   gpointer data);
 TotemPlParserResult totem_pl_parser_add_block (TotemPlParser *parser,
-					       const char *url,
-					       const char *base,
+					       GFile *file,
+					       GFile *base_file,
 					       gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-misc.c
===================================================================
--- plparse/totem-pl-parser-misc.c	(revision 41)
+++ plparse/totem-pl-parser-misc.c	(working copy)
@@ -42,9 +42,12 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult
-totem_pl_parser_add_gvp (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_gvp (TotemPlParser *parser,
+			 GFile *url,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines, *title, *link, *version;
 	int size;
@@ -86,12 +89,16 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_desktop (TotemPlParser *parser, const char *url,
-			     const char *base, gpointer data)
+totem_pl_parser_add_desktop (TotemPlParser *parser,
+			     GFile *file,
+			     GFile *base_file,
+			     gpointer data)
 {
+#if 0
 	char *contents, **lines;
 	const char *path, *display_name, *type;
 	int size;
@@ -132,6 +139,7 @@
 	g_strfreev (lines);
 
 	return res;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-podcast.c
===================================================================
--- plparse/totem-pl-parser-podcast.c	(revision 46)
+++ plparse/totem-pl-parser-podcast.c	(working copy)
@@ -235,10 +235,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_rss (TotemPlParser *parser,
-			 const char *url,
-			 const char *base,
+			 GFile *file,
+			 GFile *base_file,
 			 gpointer data)
 {
+#if 0
 	xml_node_t* doc, *channel;
 	char *contents;
 	int size;
@@ -269,17 +270,18 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 /* http://www.apple.com/itunes/store/podcaststechspecs.html */
 TotemPlParserResult
 totem_pl_parser_add_itpc (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	TotemPlParserResult ret;
 	char *new_url;
 
@@ -289,6 +291,7 @@
 	g_free (new_url);
 
 	return ret;
+#endif
 }
 
 /* Atom docs:
@@ -423,10 +426,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_atom (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *contents;
 	int size;
@@ -451,14 +455,14 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
 totem_pl_parser_add_xml_feed (TotemPlParser *parser,
-			      const char *url,
-			      const char *base,
+			      GFile *file,
+			      GFile *base_file,
 			      gpointer data)
 {
 	guint len;
@@ -469,11 +473,11 @@
 	len = strlen (data);
 
 	if (totem_pl_parser_is_rss (data, len) != FALSE)
-		return totem_pl_parser_add_rss (parser, url, base, data);
+		return totem_pl_parser_add_rss (parser, file, base_file, data);
 	if (totem_pl_parser_is_atom (data, len) != FALSE)
-		return totem_pl_parser_add_atom (parser, url, base, data);
+		return totem_pl_parser_add_atom (parser, file, base_file, data);
 	if (totem_pl_parser_is_opml (data, len) != FALSE)
-		return totem_pl_parser_add_opml (parser, url, base, data);
+		return totem_pl_parser_add_opml (parser, file, base_file, data);
 
 	return TOTEM_PL_PARSER_RESULT_UNHANDLED;
 }
@@ -642,10 +646,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_itms (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	char *contents, *uncompressed, *itms_url, *feed_url;
 	TotemPlParserResult ret;
 	int size;
@@ -689,14 +694,16 @@
 	g_free (feed_url);
 
 	return ret;
+#endif
 }
 
 gboolean
-totem_pl_parser_is_itms_feed (const char *url)
+totem_pl_parser_is_itms_feed (GFile *file)
 {
+#if 0
 	g_return_val_if_fail (url != NULL, FALSE);
 
-	if (g_str_has_prefix (url, "itms:") != FALSE
+	if (g_file_has_uri_scheme (file, "itms:") != FALSE
 	    && strstr (url, "phobos.apple.com") != NULL
 	    && strstr (url, "viewPodcast") != NULL)
 		return TRUE;
@@ -705,7 +712,7 @@
 		return TRUE;
 	if (strstr (url, "itunes.com/podcast") != NULL)
 		return TRUE;
-
+#endif
 	return FALSE;
 }
 
@@ -766,10 +773,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_opml (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *contents;
 	int size;
@@ -794,7 +802,7 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
Index: plparse/totem-pl-parser-pls.c
===================================================================
--- plparse/totem-pl-parser-pls.c	(revision 41)
+++ plparse/totem-pl-parser-pls.c	(working copy)
@@ -148,9 +148,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pls_with_contents (TotemPlParser *parser, const char *url,
-				       const char *base, const char *contents)
+totem_pl_parser_add_pls_with_contents (TotemPlParser *parser,
+				       GFile *file,
+				       GFile *base_file,
+				       const char *contents)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char **lines;
 	int i, num_entries;
@@ -299,12 +302,16 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pls (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_pls (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents;
 	int size;
@@ -321,6 +328,7 @@
 	g_free (contents);
 
 	return retval;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-misc.h
===================================================================
--- plparse/totem-pl-parser-misc.h	(revision 41)
+++ plparse/totem-pl-parser-misc.h	(working copy)
@@ -27,18 +27,19 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_gvp (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_desktop (TotemPlParser *parser,
-						 const char *url,
-						 const char *base,
+						 GFile *file,
+						 GFile *base_file,
 						 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-podcast.h
===================================================================
--- plparse/totem-pl-parser-podcast.h	(revision 46)
+++ plparse/totem-pl-parser-podcast.h	(working copy)
@@ -26,6 +26,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -36,31 +37,31 @@
 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);
+gboolean totem_pl_parser_is_itms_feed (GFile *file);
 
 TotemPlParserResult totem_pl_parser_add_xml_feed (TotemPlParser *parser,
-						  const char *url,
-						  const char *base,
+						  GFile *file,
+						  GFile *base_file,
 						  gpointer data);
 TotemPlParserResult totem_pl_parser_add_atom (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_rss (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_itpc (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_itms (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_opml (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-pls.h
===================================================================
--- plparse/totem-pl-parser-pls.h	(revision 41)
+++ plparse/totem-pl-parser-pls.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_pls				(TotemPlParser *parser,
@@ -38,12 +39,12 @@
 								 gpointer user_data,
 								 GError **error);
 TotemPlParserResult totem_pl_parser_add_pls_with_contents	(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 const char *contents);
 TotemPlParserResult totem_pl_parser_add_pls			(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-smil.c
===================================================================
--- plparse/totem-pl-parser-smil.c	(revision 41)
+++ plparse/totem-pl-parser-smil.c	(working copy)
@@ -169,9 +169,11 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_smil (TotemPlParser *parser, const char *url,
-			  const char *_base, gpointer data)
+totem_pl_parser_add_smil (TotemPlParser *parser,
+			  GFile *file,
+			  GFile *base_file, gpointer data)
 {
+#if 0
 	char *contents;
 	int size;
 	TotemPlParserResult retval;
@@ -179,15 +181,19 @@
 	if (gnome_vfs_read_entire_file (url, &size, &contents) != GNOME_VFS_OK)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
 
-	retval = totem_pl_parser_add_smil_with_data (parser, url,
-						     _base, contents, size);
+	retval = totem_pl_parser_add_smil_with_data (parser, file,
+						     base_file, contents, size);
 	g_free (contents);
+
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_smil_with_data (TotemPlParser *parser, const char *url,
-				    const char *_base, const char *contents, int size)
+totem_pl_parser_add_smil_with_data (TotemPlParser *parser,
+				    GFile *file,
+				    GFile *base_file,
+				    const char *contents, int size)
 {
 	xml_node_t* doc;
 	TotemPlParserResult retval;
@@ -196,7 +202,7 @@
 	if (xml_parser_build_tree_with_options (&doc, XML_PARSER_RELAXED | XML_PARSER_MULTI_TEXT) < 0)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
 
-	retval = totem_pl_parser_add_smil_with_doc (parser, url, _base, doc);
+	retval = totem_pl_parser_add_smil_with_doc (parser, file, base_file, doc);
 	xml_parser_free_tree (doc);
 
 	return retval;
Index: plparse/totem-pl-parser-smil.h
===================================================================
--- plparse/totem-pl-parser-smil.h	(revision 41)
+++ plparse/totem-pl-parser-smil.h	(working copy)
@@ -27,18 +27,19 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_smil (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_smil_with_data (TotemPlParser *parser,
-							const char *url,
-							const char *base,
+							GFile *file,
+							GFile *base_file,
 							const char *contents,
 							int size);
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-lines.c
===================================================================
--- plparse/totem-pl-parser-lines.c	(revision 46)
+++ plparse/totem-pl-parser-lines.c	(working copy)
@@ -250,14 +250,15 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_ram (TotemPlParser *parser, const char *url, gpointer data)
+totem_pl_parser_add_ram (TotemPlParser *parser, GFile *file, gpointer data)
 {
 	gboolean retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines;
-	int size, i;
+	gsize size;
+	guint i;
 	const char *split_char;
 
-	if (gnome_vfs_read_entire_file (url, &size, &contents) != GNOME_VFS_OK)
+	if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
 
 	/* figure out whether we're a unix or dos RAM file */
@@ -279,14 +280,19 @@
 		/* Either it's a URI, or it has a proper path ... */
 		if (strstr(lines[i], "://") != NULL
 				|| lines[i][0] == G_DIR_SEPARATOR) {
+			GFile *line_file;
+
+			line_file = g_file_new_for_uri (lines[i]);
 			/* .ram files can contain .smil entries */
-			if (totem_pl_parser_parse_internal (parser, lines[i], NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
+			if (totem_pl_parser_parse_internal (parser, line_file, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS)
 				totem_pl_parser_parse_ram_url (parser, lines[i]);
-			}
+			g_object_unref (line_file);
 		} else if (strcmp (lines[i], "--stop--") == 0) {
 			/* For Real Media playlists, handle the stop command */
 			break;
 		} else {
+			//FIXME
+#if 0
 			char *base;
 
 			/* Try with a base */
@@ -300,6 +306,7 @@
 				g_free (fullpath);
 			}
 			g_free (base);
+#endif
 		}
 	}
 
@@ -363,9 +370,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_m3u (TotemPlParser *parser, const char *url,
-			const char *_base, gpointer data)
+totem_pl_parser_add_m3u (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *_base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines;
 	int size, i;
@@ -464,18 +474,21 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_ra (TotemPlParser *parser, const char *url,
-			const char *base, gpointer data)
+totem_pl_parser_add_ra (TotemPlParser *parser,
+			GFile *file,
+			GFile *base_file, gpointer data)
 {
+#if 0
 	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;
 	}
-
-	return totem_pl_parser_add_ram (parser, url, NULL);
+#endif
+	return totem_pl_parser_add_ram (parser, file, NULL);
 }
 
 
Index: plparse/totem-pl-parser-lines.h
===================================================================
--- plparse/totem-pl-parser-lines.h	(revision 46)
+++ plparse/totem-pl-parser-lines.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -42,15 +43,15 @@
 				    gpointer user_data,
 				    GError **error);
 TotemPlParserResult totem_pl_parser_add_ram (TotemPlParser *parser,
-					     const char *url,
+					     GFile *file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_m3u (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_ra (TotemPlParser *parser,
-					    const char *url,
-					    const char *base,
+					    GFile *file,
+					    GFile *base_file,
 					    gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-xspf.c
===================================================================
--- plparse/totem-pl-parser-xspf.c	(revision 41)
+++ plparse/totem-pl-parser-xspf.c	(working copy)
@@ -257,9 +257,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_xspf (TotemPlParser *parser, const char *url,
-			  const char *_base, gpointer data)
+totem_pl_parser_add_xspf (TotemPlParser *parser,
+			  GFile *file,
+			  GFile *_base_file,
+			  gpointer data)
 {
+#if 0
 	xmlDocPtr doc;
 	xmlNodePtr node;
 	char *base;
@@ -286,6 +289,7 @@
 	g_free (base);
 	xmlFreeDoc(doc);
 	return retval;
+#endif
 }
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-wm.c
===================================================================
--- plparse/totem-pl-parser-wm.c	(revision 46)
+++ plparse/totem-pl-parser-wm.c	(working copy)
@@ -83,9 +83,11 @@
 
 static TotemPlParserResult
 totem_pl_parser_add_asf_reference_parser (TotemPlParser *parser,
-					  const char *url, const char *base,
+					  GFile *file,
+					  GFile *base_file,
 					  gpointer data)
 {
+#if 0
 	char *contents, **lines, *ref, *split_char;
 	int size;
 
@@ -119,15 +121,17 @@
 	 * supposed to be a fallback */
 
 	g_strfreev (lines);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 static TotemPlParserResult
 totem_pl_parser_add_asf_parser (TotemPlParser *parser,
-				const char *url, const char *base,
+				GFile *file,
+				GFile *base_file,
 				gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, *ref;
 	int size;
@@ -157,7 +161,9 @@
 	}
 
 	g_free (contents);
+
 	return retval;
+#endif
 }
 
 static gboolean
@@ -260,7 +266,8 @@
 	fullpath = totem_pl_parser_resolve_url (base, url);
 
 	/* .asx files can contain references to other .asx files */
-	retval = totem_pl_parser_parse_internal (parser, fullpath, NULL);
+	//FIXME
+	//retval = totem_pl_parser_parse_internal (parser, fullpath, NULL);
 	if (retval != TOTEM_PL_PARSER_RESULT_SUCCESS) {
 		totem_pl_parser_add_url (parser,
 					 TOTEM_PL_PARSER_FIELD_URL, fullpath,
@@ -368,10 +375,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_asx (TotemPlParser *parser,
-			 const char *url,
-			 const char *base,
+			 GFile *file,
+			 GFile *base_file,
 			 gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *_base, *contents;
 	int size;
@@ -411,12 +419,16 @@
 	xml_parser_free_tree (doc);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_asf (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_asf (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	if (data == NULL) {
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
@@ -426,8 +438,8 @@
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
-
-	return totem_pl_parser_add_asf_parser (parser, url, base, data);
+#endif
+	return totem_pl_parser_add_asf_parser (parser, file, base_file, data);
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-qt.c
===================================================================
--- plparse/totem-pl-parser-qt.c	(revision 46)
+++ plparse/totem-pl-parser-qt.c	(working copy)
@@ -69,10 +69,11 @@
 
 static TotemPlParserResult
 totem_pl_parser_add_quicktime_rtsptext (TotemPlParser *parser,
-					const char *url,
-					const char *base,
+					GFile *file,
+					GFile *base_file,
 					gpointer data)
 {
+#if 0
 	char *contents = NULL;
 	gboolean dos_mode = FALSE;
 	char *volume, *autoplay, *rtspurl;
@@ -104,14 +105,16 @@
 	g_free (volume);
 	g_free (autoplay);
 	g_strfreev (lines);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 static TotemPlParserResult
-totem_pl_parser_add_quicktime_metalink (TotemPlParser *parser, const char *url,
-					const char *base, gpointer data)
+totem_pl_parser_add_quicktime_metalink (TotemPlParser *parser,
+					GFile *file,
+					GFile *base_file, gpointer data)
 {
+#if 0
 	xml_node_t *doc, *node;
 	int size;
 	char *contents;
@@ -189,20 +192,23 @@
 				 TOTEM_PL_PARSER_FIELD_AUTOPLAY, autoplay,
 				 NULL);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_quicktime (TotemPlParser *parser, const char *url,
-			       const char *base, gpointer data)
+totem_pl_parser_add_quicktime (TotemPlParser *parser,
+			       GFile *file,
+			       GFile *base_file,
+			       gpointer data)
 {
+#if 0
 	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;
 	}
-
-	return totem_pl_parser_add_quicktime_metalink (parser, url, base, data);
+#endif
+	return totem_pl_parser_add_quicktime_metalink (parser, file, base_file, data);
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-xspf.h
===================================================================
--- plparse/totem-pl-parser-xspf.h	(revision 41)
+++ plparse/totem-pl-parser-xspf.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_xspf (TotemPlParser *parser,
@@ -38,8 +39,8 @@
 				     gpointer user_data,
 				     GError **error);
 TotemPlParserResult totem_pl_parser_add_xspf (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-wm.h
===================================================================
--- plparse/totem-pl-parser-wm.h	(revision 46)
+++ plparse/totem-pl-parser-wm.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -36,12 +37,12 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_asf (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_asx (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-qt.h
===================================================================
--- plparse/totem-pl-parser-qt.h	(revision 46)
+++ plparse/totem-pl-parser-qt.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -35,8 +36,8 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_quicktime (TotemPlParser *parser,
-						   const char *url,
-						   const char *base,
+						   GFile *file,
+						   GFile *base_file,
 						   gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser.c
===================================================================
--- plparse/totem-pl-parser.c	(revision 46)
+++ plparse/totem-pl-parser.c	(working copy)
@@ -103,6 +103,8 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include <gobject/gvaluecollector.h>
 #include <gtk/gtk.h>
+#include <gio/gio.h>
+
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
@@ -134,7 +136,7 @@
 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);
+typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, GFile *url, GFile *base_file, gpointer data);
 #endif
 
 typedef struct {
@@ -610,89 +612,72 @@
 }
 
 static char *
-my_gnome_vfs_get_mime_type_with_data (const char *uri, gpointer *data, TotemPlParser *parser)
+my_gnome_vfs_get_mime_type_with_data (GFile *file, gpointer *data, TotemPlParser *parser)
 {
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
 	char *buffer;
-	const char *mimetype;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
+	char *mimetype;
+	gssize bytes_read;
+	GFileInputStream *stream;
+	GError *error = NULL;
 
 	*data = NULL;
 
 	/* Stat for a block device, we're screwed as far as speed
 	 * is concerned now */
-	if (g_str_has_prefix (uri, "file://") != FALSE) {
+	if (g_file_has_uri_scheme (file, "file") != FALSE) {
+		//FIXME
+#if 0
 		struct stat buf;
-		if (stat (uri + strlen ("file://"), &buf) == 0) {
+		if (g_stat (uri + strlen ("file://"), &buf) == 0) {
 			if (S_ISBLK (buf.st_mode))
 				return g_strdup (BLOCK_DEVICE_TYPE);
 		}
+#endif
 	}
 
 	/* Open the file. */
-	result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
-	if (result != GNOME_VFS_OK) {
-		if (result == GNOME_VFS_ERROR_IS_DIRECTORY)
+	stream = g_file_read (file, NULL, &error);
+	if (stream == NULL) {
+		if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY) != FALSE) {
+			g_error_free (error);
 			return g_strdup (DIR_MIME_TYPE);
-		DEBUG(g_print ("URL '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result)));
+		}
+		DEBUG(g_print ("URL '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", NULL /* FIXME uri */, error->message));
+		g_error_free (error);
 		return NULL;
 	}
-	DEBUG(g_print ("URL '%s' was opened successfully in _get_mime_type_with_data:\n", uri));
+	DEBUG(g_print ("URL '%s' was opened successfully in _get_mime_type_with_data:\n", NULL /*FIXME uri */));
 
 	/* Read the whole thing, up to MIME_READ_CHUNK_SIZE */
-	buffer = NULL;
-	total_bytes_read = 0;
-	bytes_read = 0;
-	do {
-		buffer = g_realloc (buffer, total_bytes_read
-				+ MIME_READ_CHUNK_SIZE);
-		result = gnome_vfs_read (handle,
-				buffer + total_bytes_read,
-				MIME_READ_CHUNK_SIZE,
-				&bytes_read);
-		if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		/* Check for overflow. */
-		if (total_bytes_read + bytes_read < total_bytes_read) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		total_bytes_read += bytes_read;
-	} while (result == GNOME_VFS_OK
-			&& total_bytes_read < MIME_READ_CHUNK_SIZE);
-
-	/* Close the file but don't overwrite the possible error */
-	if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF)
-		gnome_vfs_close (handle);
-	else
-		result = gnome_vfs_close (handle);
-
-	if (result != GNOME_VFS_OK) {
-		DEBUG(g_print ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result)));
+	buffer = g_malloc (MIME_READ_CHUNK_SIZE);
+	bytes_read = g_input_stream_read (G_INPUT_STREAM (stream), buffer, MIME_READ_CHUNK_SIZE, NULL, &error);
+	g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL);
+	if (bytes_read == -1) {
 		g_free (buffer);
 		return NULL;
 	}
 
 	/* Empty file */
-	if (total_bytes_read == 0) {
-		DEBUG(g_print ("URL '%s' is empty in _get_mime_type_with_data\n", uri));
+	if (bytes_read == 0) {
+		g_free (buffer);
+		DEBUG(g_print ("URL '%s' is empty in _get_mime_type_with_data\n", NULL /* FIXME uri */));
 		return g_strdup (EMPTY_FILE_TYPE);
 	}
 
 	/* Return the file null-terminated. */
-	buffer = g_realloc (buffer, total_bytes_read + 1);
-	buffer[total_bytes_read] = '\0';
+	buffer = g_realloc (buffer, bytes_read + 1);
+	buffer[bytes_read] = '\0';
 	*data = buffer;
 
-	mimetype = gnome_vfs_get_mime_type_for_data (*data, total_bytes_read);
+#ifdef G_OS_WIN32
+	{
+		char *content_type;
+		content_type = g_content_type_guess (NULL, *data, bytes_read, NULL);
+		mimetype = g_content_type_get_mime_type (content_type);
+	}
+#else
+	mimetype = g_content_type_guess (NULL, *data, bytes_read, NULL);
+#endif
 
 	if (mimetype != NULL && strcmp (mimetype, "text/plain") == 0) {
 		PlaylistIdenCallback func;
@@ -706,13 +691,15 @@
 			if (func == dual_types[i].iden)
 				continue;
 			func = dual_types[i].iden;
-			res = func (*data, total_bytes_read);
-			if (res != NULL)
+			res = func (*data, bytes_read);
+			if (res != NULL) {
+				g_free (mimetype);
 				return g_strdup (res);
+			}
 		}
 	}
 
-	return g_strdup (mimetype);
+	return mimetype;
 }
 
 /**
@@ -1492,8 +1479,9 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_parse_internal (TotemPlParser *parser, const char *url,
-				const char *base)
+totem_pl_parser_parse_internal (TotemPlParser *parser,
+				GFile *file,
+				GFile *base_file)
 {
 	char *mimetype;
 	guint i;
@@ -1504,41 +1492,45 @@
 	if (parser->priv->recurse_level > RECURSE_LEVEL_MAX)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
 
-	/* Shouldn't gnome-vfs have a list of schemes it supports? */
-	if (g_str_has_prefix (url, "mms") != FALSE
-			|| g_str_has_prefix (url, "rtsp") != FALSE
-			|| g_str_has_prefix (url, "icy") != FALSE) {
-		DEBUG(g_print ("URL '%s' is MMS, RTSP or ICY, ignoring\n", url));
+	/* FIXME Shouldn't gio have a list of schemes it supports? */
+	if (g_file_has_uri_scheme (file, "mms") != FALSE
+			|| g_file_has_uri_scheme (file, "rtsp") != FALSE
+			|| g_file_has_uri_scheme (file, "icy") != FALSE) {
+//		DEBUG(g_print ("URL '%s' is MMS, RTSP or ICY, ignoring\n", url));
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	}
 
 	/* Fix up itpc, see http://www.apple.com/itunes/store/podcaststechspecs.html */
-	if (g_str_has_prefix (url, "itpc") != FALSE) {
-		DEBUG(g_print ("URL '%s' is getting special cased for ITPC parsing\n", url));
-		return totem_pl_parser_add_itpc (parser, url, base, NULL);
+	if (g_file_has_uri_scheme (file, "itpc") != FALSE) {
+//		DEBUG(g_print ("URL '%s' is getting special cased for ITPC parsing\n", url));
+		return totem_pl_parser_add_itpc (parser, file, base_file, NULL);
 	}
 	/* Try itms Podcast references, see itunes.py in PenguinTV */
-	if (totem_pl_parser_is_itms_feed (url) != FALSE) {
-	    	DEBUG(g_print ("URL '%s' is getting special cased for ITMS parsing\n", url));
-	    	return totem_pl_parser_add_itms (parser, url, NULL, NULL);
+	if (totem_pl_parser_is_itms_feed (file) != FALSE) {
+//	    	DEBUG(g_print ("URL '%s' is getting special cased for ITMS parsing\n", url));
+	    	return totem_pl_parser_add_itms (parser, file, NULL, NULL);
 	}
 
-	if (!parser->priv->recurse && parser->priv->recurse_level > 0) {
+	if (!parser->priv->recurse && parser->priv->recurse_level > 0)
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
-	}
 
 	/* In force mode we want to get the data */
 	if (parser->priv->force != FALSE) {
-		mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+		mimetype = my_gnome_vfs_get_mime_type_with_data (file, &data, parser);
 	} else {
-		mimetype = g_strdup (gnome_vfs_get_mime_type_for_name (url));
+		char *filename;
+
+		filename = g_file_get_uri (file);
+		//FIXME win32
+		mimetype = g_content_type_guess (filename, NULL, 0, NULL);
+		g_free (filename);
 	}
 
-	DEBUG(g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", url, mimetype));
+	DEBUG(g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", NULL /* FIXME url */, mimetype));
 	if (mimetype == NULL || strcmp (GNOME_VFS_MIME_TYPE_UNKNOWN, mimetype) == 0) {
 		g_free (mimetype);
-		mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
-		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", url, mimetype ? mimetype : "NULL"));
+		mimetype = my_gnome_vfs_get_mime_type_with_data (file, &data, parser);
+		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", NULL /* FIXME url */, mimetype ? mimetype : "NULL"));
 	}
 
 	if (mimetype == NULL) {
@@ -1556,12 +1548,12 @@
 	 * data from the playlist parser */
 	if (strcmp (mimetype, AUDIO_MPEG_TYPE) == 0 && parser->priv->recurse_level == 0 && data == NULL) {
 		char *tmp;
-		tmp = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+		tmp = my_gnome_vfs_get_mime_type_with_data (file, &data, parser);
 		if (tmp != NULL) {
 			g_free (mimetype);
 			mimetype = tmp;
 		}
-		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s' (was %s)\n", url, mimetype, AUDIO_MPEG_TYPE));
+		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s' (was %s)\n", NULL /* FIXME url */, mimetype, AUDIO_MPEG_TYPE));
 	}
 
 	if (totem_pl_parser_mimetype_is_ignored (parser, mimetype) != FALSE) {
@@ -1575,13 +1567,13 @@
 
 		for (i = 0; i < G_N_ELEMENTS(special_types); i++) {
 			if (strcmp (special_types[i].mimetype, mimetype) == 0) {
-				DEBUG(g_print ("URL '%s' is special type '%s'\n", url, mimetype));
+				DEBUG(g_print ("URL '%s' is special type '%s'\n", NULL /* FIXME url */, mimetype));
 				if (parser->priv->disable_unsafe != FALSE && special_types[i].unsafe != FALSE) {
 					g_free (mimetype);
 					g_free (data);
 					return TOTEM_PL_PARSER_RESULT_IGNORED;
 				}
-				ret = (* special_types[i].func) (parser, url, base, data);
+				ret = (* special_types[i].func) (parser, file, base_file, data);
 				found = TRUE;
 				break;
 			}
@@ -1589,12 +1581,12 @@
 
 		for (i = 0; i < G_N_ELEMENTS(dual_types) && found == FALSE; i++) {
 			if (strcmp (dual_types[i].mimetype, mimetype) == 0) {
-				DEBUG(g_print ("URL '%s' is dual type '%s'\n", url, mimetype));
+				DEBUG(g_print ("URL '%s' is dual type '%s'\n", NULL /* FIXME url */, mimetype));
 				if (data == NULL) {
 					g_free (mimetype);
-					mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+					mimetype = my_gnome_vfs_get_mime_type_with_data (file, &data, parser);
 				}
-				ret = (* dual_types[i].func) (parser, url, base, data);
+				ret = (* dual_types[i].func) (parser, file, base_file, data);
 				found = TRUE;
 				break;
 			}
@@ -1617,7 +1609,8 @@
 	g_free (mimetype);
 
 	if (ret != TOTEM_PL_PARSER_RESULT_SUCCESS && parser->priv->fallback) {
-		totem_pl_parser_add_one_url (parser, url, NULL);
+		//FIXME
+		totem_pl_parser_add_one_url (parser, file, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
 
@@ -1641,18 +1634,33 @@
 totem_pl_parser_parse_with_base (TotemPlParser *parser, const char *url,
 				 const char *base, gboolean fallback)
 {
+	GFile *file, *base_file;
+	TotemPlParserResult retval;
+
 	g_return_val_if_fail (TOTEM_IS_PL_PARSER (parser), TOTEM_PL_PARSER_RESULT_UNHANDLED);
 	g_return_val_if_fail (url != NULL, TOTEM_PL_PARSER_RESULT_UNHANDLED);
+	g_return_val_if_fail (strstr (url, "://") != NULL,
+			TOTEM_PL_PARSER_RESULT_ERROR);
 
-	if (totem_pl_parser_scheme_is_ignored (parser, url) != FALSE)
+	file = g_file_new_for_uri (url);
+	base_file = NULL;
+
+	if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
+		g_object_unref (file);
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
+	}
 
-	g_return_val_if_fail (strstr (url, "://") != NULL,
-			TOTEM_PL_PARSER_RESULT_ERROR);
-
 	parser->priv->recurse_level = 0;
 	parser->priv->fallback = fallback != FALSE;
-	return totem_pl_parser_parse_internal (parser, url, base);
+	if (base != NULL)
+		base_file = g_file_new_for_uri (base);
+	retval = totem_pl_parser_parse_internal (parser, file, base_file);
+
+	g_object_unref (file);
+	if (base_file != NULL)
+		g_object_unref (base_file);
+
+	return retval;
 }
 
 /**
