public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in media-video/totem/files: totem-2.26.5-firefox-plugin-apple-trailers.patch
@ 2009-12-30  1:25 Nirbheek Chauhan (nirbheek)
  0 siblings, 0 replies; only message in thread
From: Nirbheek Chauhan (nirbheek) @ 2009-12-30  1:25 UTC (permalink / raw
  To: gentoo-commits

nirbheek    09/12/30 01:25:30

  Added:                totem-2.26.5-firefox-plugin-apple-trailers.patch
  Log:
  Fix playing of apple trailers using the firefox plugin, bug 292852
  (Portage version: 2.1.7.16/cvs/Linux i686)

Revision  Changes    Path
1.1                  media-video/totem/files/totem-2.26.5-firefox-plugin-apple-trailers.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/totem/files/totem-2.26.5-firefox-plugin-apple-trailers.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/totem/files/totem-2.26.5-firefox-plugin-apple-trailers.patch?rev=1.1&content-type=text/plain

Index: totem-2.26.5-firefox-plugin-apple-trailers.patch
===================================================================
Fixes playing of apple trailers using the firefox plugin by changing the UA

Patch backported by Ryan May

http://bugs.gentoo.org/show_bug.cgi?id=292852

---
--- browser-plugin/totemPlugin.cpp
+++ browser-plugin/totemPlugin.cpp
@@ -156,6 +156,15 @@
   "The <a href=\"http://www.gnome.org/projects/totem/\">Totem</a> " PACKAGE_VERSION " plugin handles video and audio streams.";
 #endif
 
+static const char kPluginUserAgent[] =
+#if defined(TOTEM_NARROWSPACE_PLUGIN)
+  "Quicktime/"TOTEM_NARROWSPACE_VERSION;
+#elif defined(TOTEM_GMP_PLUGIN)
+  "Windows-Media-Player/10.00.00.4019";
+#else
+  "";
+#endif
+
 #if defined(TOTEM_COMPLEX_PLUGIN) && defined(HAVE_NSTARRAY_H)
 nsTArray<totemPlugin*> *totemPlugin::sPlugins;
 
@@ -463,10 +472,13 @@
 		return NPERR_NO_ERROR;
 #endif /* TOTEM_COMPLEX_PLUGIN */
 
-	const char *userAgent = NPN_UserAgent (mNPP);
-	if (!userAgent) {
-		/* See https://bugzilla.mozilla.org/show_bug.cgi?id=328778 */
-		D ("User agent has more than 127 characters; fix your browser!");
+	const char *userAgent = kPluginUserAgent;
+	if (*kPluginUserAgent == '\0') {
+		userAgent = NPN_UserAgent (mNPP);
+		if (!userAgent) {
+			/* See https://bugzilla.mozilla.org/show_bug.cgi?id=328778 */
+			D ("User agent has more than 127 characters; fix your browser!");
+		}
 	}
 
         GPtrArray *arr = g_ptr_array_new ();
--- browser-plugin/totem-plugin-viewer.c
+++ browser-plugin/totem-plugin-viewer.c
@@ -2336,7 +2336,7 @@
 	/* FIXME: this won't work with gvfs:
 	 * http://bugzilla.gnome.org/show_bug.cgi?id=534482 */
 	if (arg_user_agent != NULL) {
-		g_setenv ("GNOME_VFS_HTTP_USER_AGENT", arg_user_agent, TRUE);
+		g_setenv ("BACON_VIDEO_WIDGET_HTTP_USER_AGENT", arg_user_agent, TRUE);
 		g_free (arg_user_agent);
 		arg_user_agent = NULL;
 	}
--- src/backend/bacon-video-widget-gst-0.10.c
+++ src/backend/bacon-video-widget-gst-0.10.c
@@ -1686,6 +1686,21 @@
 }
 
 static void
+bvw_set_user_agent_on_element (BaconVideoWidget * bvw, GstElement * element)
+{
+  const char *ua;
+
+  ua = g_getenv ("BACON_VIDEO_WIDGET_HTTP_USER_AGENT");
+  if (ua == NULL)
+    return;
+
+  if (g_object_class_find_property (G_OBJECT_GET_CLASS (element), "user-agent")) {
+    GST_DEBUG ("Setting HTTP user-agent to '%s'", ua);
+    g_object_set (element, "user-agent", ua, NULL);
+  }
+}
+
+static void
 playbin_source_notify_cb (GObject *play, GParamSpec *p, BaconVideoWidget *bvw)
 {
   GObject *source = NULL;
@@ -1709,6 +1724,7 @@
   if (source) {
     GST_DEBUG ("Got source of type %s", G_OBJECT_TYPE_NAME (source));
     bvw_set_device_on_element (bvw, GST_ELEMENT (source));
+    bvw_set_user_agent_on_element (bvw, GST_ELEMENT (source));
     g_object_unref (source);
   }
 }






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-30  1:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30  1:25 [gentoo-commits] gentoo-x86 commit in media-video/totem/files: totem-2.26.5-firefox-plugin-apple-trailers.patch Nirbheek Chauhan (nirbheek)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox