diff options
author | drochner <drochner@pkgsrc.org> | 2010-08-04 17:46:52 +0000 |
---|---|---|
committer | drochner <drochner@pkgsrc.org> | 2010-08-04 17:46:52 +0000 |
commit | e0edaf4444797c5e1955071d66e1706109bd193d (patch) | |
tree | 8b16f02d8c31b9f2f5446b8e24fa15ad0773ee44 /multimedia/totem | |
parent | 3c27ebb0813a94150cd18c07d3c0a8c6ae93805f (diff) | |
download | pkgsrc-e0edaf4444797c5e1955071d66e1706109bd193d.tar.gz |
replace my poor fix with the upstream version
Diffstat (limited to 'multimedia/totem')
-rw-r--r-- | multimedia/totem/distinfo | 4 | ||||
-rw-r--r-- | multimedia/totem/patches/patch-aj | 85 |
2 files changed, 78 insertions, 11 deletions
diff --git a/multimedia/totem/distinfo b/multimedia/totem/distinfo index c90973c4153..4942d201dd9 100644 --- a/multimedia/totem/distinfo +++ b/multimedia/totem/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.41 2010/08/02 10:24:33 drochner Exp $ +$NetBSD: distinfo,v 1.42 2010/08/04 17:46:52 drochner Exp $ SHA1 (totem-2.30.2.tar.gz) = 3f09d21994b3caa9aa4eca9f1fa9021a263bdc92 RMD160 (totem-2.30.2.tar.gz) = 302963f368d7dcdb782d9350c03133413ff4dc33 @@ -6,4 +6,4 @@ Size (totem-2.30.2.tar.gz) = 4839425 bytes SHA1 (patch-ad) = ec8cd092d202255981049ace4ac643c41a0044be SHA1 (patch-af) = 8e4ffb97aedbf56a052d5ffacea73f8b2f071183 SHA1 (patch-ai) = 6f95138b8260dc925493845e34a7b7e9f6f93a53 -SHA1 (patch-aj) = 2eedc2d45e985d9f67ca23477adc3ba596c12af1 +SHA1 (patch-aj) = e052ec5431e776c6754d50d98e70d3d88259404a diff --git a/multimedia/totem/patches/patch-aj b/multimedia/totem/patches/patch-aj index c243457aee6..fce03bf6b38 100644 --- a/multimedia/totem/patches/patch-aj +++ b/multimedia/totem/patches/patch-aj @@ -1,12 +1,79 @@ -$NetBSD: patch-aj,v 1.1 2010/08/02 10:24:33 drochner Exp $ +$NetBSD: patch-aj,v 1.2 2010/08/04 17:46:52 drochner Exp $ --- src/plugins/youtube/totem-youtube.c.orig 2010-05-12 15:41:25.000000000 +0000 +++ src/plugins/youtube/totem-youtube.c -@@ -530,6 +530,7 @@ resolve_t_param_cb (GObject *source_obje - g_string_append_uri_escaped (video_uri_string, video_id, NULL, TRUE); - g_string_append (video_uri_string, "&t="); - g_string_append_uri_escaped (video_uri_string, t_param, NULL, TRUE); -+ g_string_append (video_uri_string, "&asv="); - g_string_append (video_uri_string, fmt_param); - - video_uri = g_string_free (video_uri_string, FALSE); +@@ -394,14 +394,6 @@ impl_deactivate (TotemPlugin *plugin, To + g_regex_unref (self->regex); + } + +-static const gchar * +-get_fmt_param (TotemYouTubePlugin *self) +-{ +- if (bacon_video_widget_get_connection_speed (self->bvw) >= 10) +- return "&fmt=18"; +- return ""; +-} +- + typedef struct { + TotemYouTubePlugin *plugin; + guint tree_view; +@@ -510,29 +502,32 @@ resolve_t_param_cb (GObject *source_obje + + video_id = gdata_youtube_video_get_video_id (GDATA_YOUTUBE_VIDEO (data->entry)); + +- /* Check for the t parameter, which is now in a JavaScript array on the video page */ ++ /* Check for the fmt_url_map parameter */ + g_regex_match (self->regex, contents, 0, &match_info); + if (g_match_info_matches (match_info) == TRUE) { +- gchar *t_param, *s; +- const gchar *fmt_param; +- GString *video_uri_string; ++ gchar *fmt_url_map_escaped, *fmt_url_map; ++ gchar **mappings, **i; + + /* We have a match */ +- s = g_match_info_fetch (match_info, 1); +- t_param = g_uri_unescape_string (s, NULL); +- if (t_param == NULL) +- t_param = s; +- else +- g_free (s); +- fmt_param = get_fmt_param (self); +- +- video_uri_string = g_string_new ("http://www.youtube.com/get_video?video_id="); +- g_string_append_uri_escaped (video_uri_string, video_id, NULL, TRUE); +- g_string_append (video_uri_string, "&t="); +- g_string_append_uri_escaped (video_uri_string, t_param, NULL, TRUE); +- g_string_append (video_uri_string, fmt_param); ++ fmt_url_map_escaped = g_match_info_fetch (match_info, 1); ++ fmt_url_map = g_uri_unescape_string (fmt_url_map_escaped, NULL); ++ g_free (fmt_url_map_escaped); ++ ++ /* The fmt_url_map parameter is in the following format: ++ * fmt1|uri1,fmt2|uri2,fmt3|uri3,... ++ * where fmtN is an identifier for the audio and video encoding and resolution as described here: ++ * (http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs) and uriN is the playback URI for that format. */ ++ mappings = g_strsplit (fmt_url_map, ",", 0); ++ ++ for (i = mappings; *i != NULL; i++) { ++ /* For the moment we just take the first format we get */ ++ gchar **mapping = g_strsplit (*i, "|", 2); ++ video_uri = g_strdup (mapping[1]); ++ g_strfreev (mapping); ++ break; ++ } + +- video_uri = g_string_free (video_uri_string, FALSE); ++ g_strfreev (mappings); + } else { + GDataMediaContent *content; + +@@ -854,7 +849,7 @@ search_button_clicked_cb (GtkButton *but + * cycles repeatedly creating new regexes for each video whose t param we resolve. */ + /* We're looking for a line of the form: + * var swfHTML = (isIE) ? "<object...econds=194&t=vjVQa1PpcFP36LLlIaDqZIG1w6e30b-7WVBgsQLLA3s%3D&rv.6.id=OzLjC6Pm... */ +- self->regex = g_regex_new ("swfHTML = .*&t=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL); ++ self->regex = g_regex_new ("swfHTML = .*&fmt_url_map=([^&]+)&", G_REGEX_OPTIMIZE, 0, NULL); + g_assert (self->regex != NULL); + + /* Set up the GData service (needed for the tree views' queries) */ |