[Swfdec-commits] 2 commits - src/swfmoz_config.c src/swfmoz_loader.c src/swfmoz_loader.h src/swfmoz_player.c

Benjamin Otte company at kemper.freedesktop.org
Wed Jul 23 09:13:50 PDT 2008


 src/swfmoz_config.c |   10 ++++++++--
 src/swfmoz_loader.c |    1 +
 src/swfmoz_loader.h |    1 +
 src/swfmoz_player.c |   17 ++++++++++++++---
 4 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 7626dc407ba0c913fcd679adea6ff3937d43bdaa
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jul 22 14:51:56 2008 +0200

    append the flashvars to the initial file's url

diff --git a/src/swfmoz_loader.c b/src/swfmoz_loader.c
index afe33af..01c0757 100644
--- a/src/swfmoz_loader.c
+++ b/src/swfmoz_loader.c
@@ -60,6 +60,7 @@ swfmoz_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
   if (mozplay->initial) {
     swfmoz_loader_set_stream (moz, mozplay->initial);
     mozplay->initial = NULL;
+    moz->initial = TRUE;
   } else {
     g_object_ref (moz);
     if (buffer) {
diff --git a/src/swfmoz_loader.h b/src/swfmoz_loader.h
index 889e542..d1c4e25 100644
--- a/src/swfmoz_loader.h
+++ b/src/swfmoz_loader.h
@@ -42,6 +42,7 @@ struct _SwfmozLoader
 
   NPP			instance;	/* instance we belong to */
   NPStream *		stream;		/* stream we do or NULL if not created yet */
+  gboolean		initial;	/* we are the initial loader */
 
   gboolean		waiting_for_stream;
   char *		cache_file;	/* where the file is cached */
diff --git a/src/swfmoz_player.c b/src/swfmoz_player.c
index ea49286..970228a 100644
--- a/src/swfmoz_player.c
+++ b/src/swfmoz_player.c
@@ -522,9 +522,10 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
   goffset loaded, size;
   gboolean error;
   const SwfdecURL *url;
+  SwfdecPlayer *player;
   const char *url_string;
   char *str_loaded, *str_size;
-  gchar *status;
+  gchar *status, *s = NULL;
 
   loaded = swfdec_loader_get_loaded (loader);
   size = swfdec_loader_get_size (loader);
@@ -551,7 +552,16 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
   }
 
   url = swfdec_loader_get_url (loader);
-  if (url) {
+  player = SWFMOZ_LOADER (loader)->instance->pdata;
+  if (url && SWFMOZ_LOADER (loader)->initial && swfdec_player_get_variables (player)) {
+    /* This auto-appends the FlashVars to the reported URL. You should be able
+     * to copy/paste that URL easily without breakage that way 
+     * (minus cookies and referer) */
+    s = g_strconcat (swfdec_url_get_url (url),
+	swfdec_url_get_query (url) ? "&" : "?",
+	swfdec_player_get_variables (player), NULL);
+    url_string = s;
+  } else if (url) {
     url_string = swfdec_url_get_url (url);
   } else if (SWFMOZ_LOADER (loader)->stream) {
     url_string = SWFMOZ_LOADER (loader)->stream->url;
@@ -567,7 +577,8 @@ swfmoz_player_loaders_update (GtkListStore *store, GtkTreeIter *iter, SwfdecLoad
     SWFMOZ_LOADER_COLUMN_STATUS, status,
     -1);
 
-  g_free(status);
+  g_free (status);
+  g_free (s);
 }
 
 static gboolean
commit 2145273ffe79a86b0230c3585e86fee4f831c892
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jul 22 14:51:42 2008 +0200

    don't throw an error when saving autoplay values either

diff --git a/src/swfmoz_config.c b/src/swfmoz_config.c
index 024bc4f..649b656 100644
--- a/src/swfmoz_config.c
+++ b/src/swfmoz_config.c
@@ -115,7 +115,7 @@ swfmoz_config_read_autoplay (SwfmozConfig *config, const char *host,
 gboolean
 swfmoz_config_should_autoplay (SwfmozConfig *config, const SwfdecURL *url)
 {
-  const gchar *host;
+  const char *host;
   gboolean autoplay = FALSE;
 
   g_return_val_if_fail (SWFMOZ_IS_CONFIG (config), FALSE);
@@ -134,9 +134,15 @@ void
 swfmoz_config_set_autoplay (SwfmozConfig *config, const SwfdecURL *url,
 			    gboolean autoplay)
 {
+  const char *host;
+
   g_return_if_fail (SWFMOZ_IS_CONFIG (config));
 
-  g_key_file_set_boolean (config->keyfile, swfdec_url_get_host (url),
+  host = swfdec_url_get_host (url);
+  if (host == NULL)
+    host = swfdec_url_get_protocol (url);
+
+  g_key_file_set_boolean (config->keyfile, host,
 			  "autoplay", autoplay);
 
   swfmoz_config_save_file (config);


More information about the Swfdec-commits mailing list