totem r5398 - in trunk: . src



Author: hadess
Date: Thu May  8 17:32:40 2008
New Revision: 5398
URL: http://svn.gnome.org/viewvc/totem?rev=5398&view=rev

Log:
2008-05-08  Bastien Nocera  <hadess hadess net>

	* src/totem.c (on_got_redirect): Fix build against totem-pl-parser
	trunk



Modified:
   trunk/ChangeLog
   trunk/src/totem.c

Modified: trunk/src/totem.c
==============================================================================
--- trunk/src/totem.c	(original)
+++ trunk/src/totem.c	Thu May  8 17:32:40 2008
@@ -1598,17 +1598,34 @@
 static void
 on_got_redirect (BaconVideoWidget *bvw, const char *mrl, Totem *totem)
 {
-	gchar *old_mrl, *new_mrl;
+	char *new_mrl;
 
-	old_mrl = totem_playlist_get_current_mrl (TOTEM_PLAYLIST (totem->playlist), NULL);
-	new_mrl = totem_pl_parser_resolve_url (old_mrl, mrl);
-	g_free (old_mrl);
+	if (strstr (mrl, "://") != NULL) {
+		new_mrl = NULL;
+	} else {
+		GFile *old_file, *parent, *new_file;
+		char *old_mrl;
+
+		/* Get the parent for the current MRL, that's our base */
+		old_mrl = totem_playlist_get_current_mrl (TOTEM_PLAYLIST (totem->playlist), NULL);
+		old_file = g_file_new_for_uri (old_mrl);
+		g_free (old_mrl);
+		parent = g_file_get_parent (old_file);
+		g_object_unref (old_file);
+
+		/* Resolve the URL */
+		new_file = g_file_get_child (parent, mrl);
+		g_object_unref (parent);
+
+		new_mrl = g_file_get_uri (new_file);
+		g_object_unref (new_file);
+	}
 
 	bacon_video_widget_close (totem->bvw);
 	totem_file_closed (totem);
 	totem_gdk_window_set_waiting_cursor (totem->win->window);
-	bacon_video_widget_open (totem->bvw, new_mrl, NULL);
-	totem_file_opened (totem, new_mrl);
+	bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL);
+	totem_file_opened (totem, new_mrl ? new_mrl : mrl);
 	gdk_window_set_cursor (totem->win->window, NULL);
 	bacon_video_widget_play (bvw, NULL);
 	g_free (new_mrl);



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