Index: src/totem.c
===================================================================
RCS file: /cvs/gnome/totem/src/totem.c,v
retrieving revision 1.492
diff -u -p -r1.492 totem.c
--- src/totem.c	18 Apr 2006 11:07:14 -0000	1.492
+++ src/totem.c	19 Apr 2006 13:18:07 -0000
@@ -1195,16 +1195,39 @@ on_next_button_clicked (GtkButton *butto
 	TOTEM_PROFILE (totem_action_next (totem));
 }
 
+static gchar *
+complete_redirect (Totem *totem, const char *location)
+{
+	char *ret, *pre, *l;
+
+	if (location != NULL && strstr (location, "://") != NULL)
+		return g_strdup (location);
+
+	pre = totem_playlist_get_current_mrl (TOTEM_PLAYLIST (totem->playlist));
+	if (pre && (l = strrchr (pre, '/')))
+	{
+		*l = '\0';
+	}
+
+	ret = g_strconcat (pre, "/", location, NULL);
+	g_free (pre);
+
+	return ret;
+}
+
 static void
 on_got_redirect (BaconVideoWidget *bvw, const char *mrl, Totem *totem)
 {
-	g_message ("on_got_redirect %s", mrl);
-	//FIXME we need to check for relative paths here
+	char *new_mrl;
+
+	new_mrl = complete_redirect (totem, mrl);
+	g_message ("on_got_redirect %s => %s", mrl, new_mrl);
 	bacon_video_widget_close (totem->bvw);
 	totem_gdk_window_set_waiting_cursor (totem->win->window);
-	bacon_video_widget_open (totem->bvw, mrl, NULL);
+	bacon_video_widget_open (totem->bvw, new_mrl, NULL);
 	gdk_window_set_cursor (totem->win->window, NULL);
 	bacon_video_widget_play (bvw, NULL);
+	g_free (new_mrl);
 }
 
 /* This is only called when we are playing a DVD */
