[Swfdec-commits] 6 commits - swfdec/swfdec_buffer.c swfdec/swfdec_file_loader.c swfdec/swfdec_url.c

Benjamin Otte company at kemper.freedesktop.org
Thu Jul 17 14:08:56 PDT 2008


 swfdec/swfdec_buffer.c                                                   |    2 -
 swfdec/swfdec_file_loader.c                                              |   19 ++++++++--
 swfdec/swfdec_url.c                                                      |    3 +
 test/trace/Makefile.am                                                   |    9 ++++
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf"       |binary
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf.trace" |    3 +
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf"       |binary
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf.trace" |    3 +
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf"       |binary
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf.trace" |    3 +
 test/trace/\320\270\320\261\321\200\320\260\320\266\321\213.as"          |   19 ++++++++++
 test/trace/getvariable-exhaustive-5.swf                                  |binary
 test/trace/getvariable-exhaustive-6.swf                                  |binary
 test/trace/getvariable-exhaustive-7.swf                                  |binary
 test/trace/getvariable-exhaustive-8.swf                                  |binary
 15 files changed, 56 insertions(+), 5 deletions(-)

New commits:
commit 4121315bd6c159252a61b9d317db29d877a9bcd0
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 23:07:45 2008 +0200

    add a test for recent file loading fixes

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 7bfb69b..5196770 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -4267,4 +4267,11 @@ EXTRA_DIST = \
 	xml-socket-properties-8.swf \
 	xml-socket-properties-8.swf.trace \
 	xscale.swf \
-	xscale.swf.trace
+	xscale.swf.trace \
+	ибражы-6.swf \
+	ибражы-6.swf.trace \
+	ибражы-7.swf \
+	ибражы-7.swf.trace \
+	ибражы-8.swf \
+	ибражы-8.swf.trace \
+	ибражы.as
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf"
new file mode 100644
index 0000000..78a6318
Binary files /dev/null and "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf" differ
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf.trace" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf.trace"
new file mode 100644
index 0000000..dc62072
--- /dev/null
+++ "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-6.swf.trace"
@@ -0,0 +1,3 @@
+/ибр%D0%B0%D0%B6%D1%8B-6.swf
+/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B-6.swf
+/ибражы-6.swf
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf"
new file mode 100644
index 0000000..74adf16
Binary files /dev/null and "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf" differ
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf.trace" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf.trace"
new file mode 100644
index 0000000..cc4172b
--- /dev/null
+++ "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-7.swf.trace"
@@ -0,0 +1,3 @@
+/ибр%D0%B0%D0%B6%D1%8B-7.swf
+/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B-7.swf
+/ибражы-7.swf
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf"
new file mode 100644
index 0000000..d39806e
Binary files /dev/null and "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf" differ
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf.trace" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf.trace"
new file mode 100644
index 0000000..1629795
--- /dev/null
+++ "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213-8.swf.trace"
@@ -0,0 +1,3 @@
+/ибр%D0%B0%D0%B6%D1%8B-8.swf
+/%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B-8.swf
+/ибражы-8.swf
diff --git "a/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213.as" "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213.as"
new file mode 100644
index 0000000..3ab5742
--- /dev/null
+++ "b/test/trace/\320\270\320\261\321\200\320\260\320\266\321\213.as"
@@ -0,0 +1,19 @@
+// makeswf -v 7 -s 200x150 -r 1 -o ибражы.swf ибражы.as
+
+if (this == _level0) {
+  count = 0;
+  spawn = function (name) {
+    count++;
+    loadMovie (name + "-" + __SWF_VERSION__ + ".swf", "_level" + count);
+  };
+
+  spawn ("ибражы");
+  spawn ("%D0%B8%D0%B1%D1%80%D0%B0%D0%B6%D1%8B");
+  spawn ("ибр%D0%B0%D0%B6%D1%8B");
+} else {
+  trace (_url.substr (_url.lastIndexOf ("/")));
+  _level0.count--;
+  if (_level0.count == 0) {
+    getURL ("fscommand:quit", "");
+  }
+}
commit 0d9864d6e90e9703398b9b2bf483f0b18556b768
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 19:55:50 2008 +0200

    make the file loader properly unescape file:// urls (fixes #16716)

diff --git a/swfdec/swfdec_file_loader.c b/swfdec/swfdec_file_loader.c
index a4fab05..c3d4819 100644
--- a/swfdec/swfdec_file_loader.c
+++ b/swfdec/swfdec_file_loader.c
@@ -44,7 +44,7 @@ swfdec_file_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
 {
   SwfdecStream *stream = SWFDEC_STREAM (loader);
   GError *error = NULL;
-  char *real, *unescape;
+  char *real, *unescape, *concat;
   SwfdecURL *url;
 
   if (swfdec_url_path_is_relative (url_string)) {
@@ -70,11 +70,19 @@ swfdec_file_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
 
   unescape = g_uri_unescape_string (swfdec_url_get_path (url), NULL);
   if (swfdec_url_get_query (url)) {
-    real = g_strconcat ("/", unescape, "?", swfdec_url_get_query (url), NULL);
+    concat = g_strconcat ("/", unescape, "?", swfdec_url_get_query (url), NULL);
   } else {
-    real = g_strconcat ("/", unescape, NULL);
+    concat = g_strconcat ("/", unescape, NULL);
   }
   g_free (unescape);
+  real = g_filename_from_utf8 (concat, -1, NULL, NULL, &error);
+  g_free (concat);
+  if (real == NULL) {
+    swfdec_stream_error (stream, "%s", error->message);
+    g_error_free (error);
+    swfdec_url_free (url);
+    return;
+  }
   buffer = swfdec_buffer_new_from_file (real, &error);
   g_free (real);
   if (buffer == NULL) {
commit e2153845750a5db897e072beb706c55d5a77f3c6
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 19:46:43 2008 +0200

    add docs about encoding

diff --git a/swfdec/swfdec_buffer.c b/swfdec/swfdec_buffer.c
index 76a496a..3112f47 100644
--- a/swfdec/swfdec_buffer.c
+++ b/swfdec/swfdec_buffer.c
@@ -223,7 +223,7 @@ swfdec_buffer_get_super (SwfdecBuffer *buffer)
 
 /**
  * swfdec_buffer_new_from_file:
- * @filename: file to read
+ * @filename: file to read, in filename encoding
  * @error: return location for a #GError or %NULL
  *
  * Creates a buffer containing the contents of the given file. If loading the
commit 157d69c31391d6c25b6094c6a00b936d0601bf89
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 19:43:14 2008 +0200

    unescape file names properly (fixes #16716)

diff --git a/swfdec/swfdec_file_loader.c b/swfdec/swfdec_file_loader.c
index acca0b7..a4fab05 100644
--- a/swfdec/swfdec_file_loader.c
+++ b/swfdec/swfdec_file_loader.c
@@ -44,7 +44,7 @@ swfdec_file_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
 {
   SwfdecStream *stream = SWFDEC_STREAM (loader);
   GError *error = NULL;
-  char *real;
+  char *real, *unescape;
   SwfdecURL *url;
 
   if (swfdec_url_path_is_relative (url_string)) {
@@ -68,8 +68,13 @@ swfdec_file_loader_load (SwfdecLoader *loader, SwfdecPlayer *player,
     return;
   }
 
-  /* FIXME: append query string here? */
-  real = g_strconcat ("/", swfdec_url_get_path (url), NULL);
+  unescape = g_uri_unescape_string (swfdec_url_get_path (url), NULL);
+  if (swfdec_url_get_query (url)) {
+    real = g_strconcat ("/", unescape, "?", swfdec_url_get_query (url), NULL);
+  } else {
+    real = g_strconcat ("/", unescape, NULL);
+  }
+  g_free (unescape);
   buffer = swfdec_buffer_new_from_file (real, &error);
   g_free (real);
   if (buffer == NULL) {
commit 3a6c04fb649da1cf51b06875d1458b76f459a2a7
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 19:42:38 2008 +0200

    Add comment about URLs not being standard

diff --git a/swfdec/swfdec_url.c b/swfdec/swfdec_url.c
index 4f893b0..e9fb4e1 100644
--- a/swfdec/swfdec_url.c
+++ b/swfdec/swfdec_url.c
@@ -38,6 +38,9 @@
  * will want to use swfdec_loader_get_url() to get its url and then use the 
  * functions in this section to access it.
  *
+ * Note that URLs inside Swfdec mirror the behavior of Flash and will therefore
+ * not miror standards behavior, but the behavior of Flash.
+ *
  * @see_also: #SwfdecLoader
  */
 
commit 00903225530a50cfd9ad009852dc5db6bd209fd4
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 17 18:11:57 2008 +0200

    compress files
    
    reduces size by 90%
    Tests were rerun to be sure the results are still the same

diff --git a/test/trace/getvariable-exhaustive-5.swf b/test/trace/getvariable-exhaustive-5.swf
index f05dde6..d252810 100644
Binary files a/test/trace/getvariable-exhaustive-5.swf and b/test/trace/getvariable-exhaustive-5.swf differ
diff --git a/test/trace/getvariable-exhaustive-6.swf b/test/trace/getvariable-exhaustive-6.swf
index e42f119..c99d14a 100644
Binary files a/test/trace/getvariable-exhaustive-6.swf and b/test/trace/getvariable-exhaustive-6.swf differ
diff --git a/test/trace/getvariable-exhaustive-7.swf b/test/trace/getvariable-exhaustive-7.swf
index bca6887..55fdda2 100644
Binary files a/test/trace/getvariable-exhaustive-7.swf and b/test/trace/getvariable-exhaustive-7.swf differ
diff --git a/test/trace/getvariable-exhaustive-8.swf b/test/trace/getvariable-exhaustive-8.swf
index b082b4e..1128dc4 100644
Binary files a/test/trace/getvariable-exhaustive-8.swf and b/test/trace/getvariable-exhaustive-8.swf differ


More information about the Swfdec-commits mailing list