public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan (nirbheek)" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in media-video/totem/files: totem-2.26.5-firefox-plugin-apple-trailers.patch
Date: Wed, 30 Dec 2009 01:25:30 +0000	[thread overview]
Message-ID: <E1NPnJa-0007t0-SK@stork.gentoo.org> (raw)

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);
   }
 }






                 reply	other threads:[~2009-12-30  1:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1NPnJa-0007t0-SK@stork.gentoo.org \
    --to=nirbheek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox