[totem] browser-plugin: Try to use the embed URI first



commit c6c60c1b4e58f99309c0ebfbf43faf47a46f7c38
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Dec 4 16:47:30 2011 +0100

    browser-plugin: Try to use the embed URI first

 browser-plugin/totemPlugin.cpp |   27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index 5545e73..071ffd0 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -2023,19 +2023,28 @@ totemPlugin::Init (NPMIMEType mimetype,
 #endif /* TOTEM_CONE_PLUGIN */
 
 #ifdef TOTEM_VEGAS_PLUGIN
+	char *oldSrc;
+	const char *useURI;
+	oldSrc = g_strdup (mSrcURI);
+
 	/* Never try to load the SWF file */
 	SetSrc ("");
 
-	if (totem_pl_parser_can_parse_from_uri (mDocumentURI, TRUE)) {
-		value = (const char *) g_hash_table_lookup (args, "flashvars");
-		if (value != NULL) {
-			TotemQueueCommand *cmd;
-			cmd = g_new0 (TotemQueueCommand, 1);
-			cmd->type = TOTEM_QUEUE_TYPE_SET_PLAYLIST;
-			cmd->string = g_strdup (mDocumentURI);
-			QueueCommand (cmd);
-		}
+	useURI = NULL;
+	if (totem_pl_parser_can_parse_from_uri (oldSrc, TRUE))
+		useURI = oldSrc;
+	else if (totem_pl_parser_can_parse_from_uri (mDocumentURI, TRUE))
+		useURI = mDocumentURI;
+
+	value = (const char *) g_hash_table_lookup (args, "flashvars");
+	if (useURI != NULL && value != NULL) {
+		TotemQueueCommand *cmd;
+		cmd = g_new0 (TotemQueueCommand, 1);
+		cmd->type = TOTEM_QUEUE_TYPE_SET_PLAYLIST;
+		cmd->string = g_strdup (useURI);
+		QueueCommand (cmd);
 	}
+	g_free (oldSrc);
 #endif
 
 #if 0 //def TOTEM_MULLY_PLUGIN



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]