openbsd-ports/x11/gnome/totem/patches/patch-src_totem_c
ajacoutot 3ca7bfe48e - make this build with new totem-pl-parser (we cannot update totem quite
yet because our gstreamer is too old)
- regen PLIST because nautilus-extensions directory changed with recent
nautilus update (spotted by jasper@)
2008-11-27 11:13:40 +00:00

48 lines
1.6 KiB
Plaintext

Bring on_got_redirect() function from totem-2.24 to make it compile with
our new totem-pl-parser.
$OpenBSD: patch-src_totem_c,v 1.1 2008/11/27 11:13:40 ajacoutot Exp $
--- src/totem.c.orig Thu Nov 27 10:57:53 2008
+++ src/totem.c Thu Nov 27 11:09:23 2008
@@ -1402,17 +1402,34 @@ drag_video_cb (GtkWidget *widget,
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);