[Swfdec-commits] 4 commits - swfdec/swfdec_as_date.c swfdec/swfdec_as_interpret.c swfdec/swfdec_url.c test/swfdec_test_plugin.c

Benjamin Otte company at kemper.freedesktop.org
Thu May 22 04:55:33 PDT 2008


 swfdec/swfdec_as_date.c      |    2 +-
 swfdec/swfdec_as_interpret.c |    2 +-
 swfdec/swfdec_url.c          |   20 ++++++++++++++------
 test/swfdec_test_plugin.c    |    2 +-
 4 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit c4f309acb316563a8f08f703fbd06e54bccead00
Author: Riccardo Magliocchetti <riccardo.magliocchetti at gmail.com>
Date:   Thu May 22 13:49:45 2008 +0200

    move bracket to the right place

diff --git a/swfdec/swfdec_as_interpret.c b/swfdec/swfdec_as_interpret.c
index 3fd9b34..831f8a3 100644
--- a/swfdec/swfdec_as_interpret.c
+++ b/swfdec/swfdec_as_interpret.c
@@ -119,7 +119,7 @@ swfdec_action_goto_frame (SwfdecAsContext *cx, guint action, const guint8 *data,
     SWFDEC_ERROR ("GotoFrame action length invalid (is %u, should be 2", len);
     return;
   }
-  frame = (data[0] | data[1] << 8);
+  frame = data[0] | (data[1] << 8);
   if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
     SwfdecSpriteMovie *movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
     swfdec_sprite_movie_goto (movie, frame + 1);
commit 7033bea183c2acce585b665f98663b90773ee527
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu May 22 13:17:24 2008 +0200

    Ignore microseconds in new Date ()
    
    This ensures that toString() or getTime() don't output decimal numbers.
    And that in turn fixes bugs with people creating new movieclips wich have a
    name based on the current time.

diff --git a/swfdec/swfdec_as_date.c b/swfdec/swfdec_as_date.c
index 14f1cd9..3260b15 100644
--- a/swfdec/swfdec_as_date.c
+++ b/swfdec/swfdec_as_date.c
@@ -1057,7 +1057,7 @@ swfdec_as_date_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
 
     swfdec_as_context_get_time (cx, &tv);
     swfdec_as_date_set_milliseconds_utc (date,
-	tv.tv_sec * 1000.0 + tv.tv_usec / 1000.0);
+	tv.tv_sec * 1000.0 + tv.tv_usec / 1000);
   }
   else if (argc == 1) // milliseconds from epoch, local
   {
commit 85b52169c64da021bc4a43d8ea52aba667806e8d
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu May 22 13:16:48 2008 +0200

    Be evil and add microseconds to the start time
    
    This is required to check that the next fix works

diff --git a/test/swfdec_test_plugin.c b/test/swfdec_test_plugin.c
index 9ee07e5..120aba3 100644
--- a/test/swfdec_test_plugin.c
+++ b/test/swfdec_test_plugin.c
@@ -131,7 +131,7 @@ swfdec_test_plugin_swfdec_notify (SwfdecPlayer *player, GParamSpec *pspec, Swfde
 void
 swfdec_test_plugin_swfdec_new (SwfdecTestPlugin *plugin)
 {
-  static const GTimeVal the_beginning = { 1035840244, 0 };
+  static const GTimeVal the_beginning = { 1035840244, 123 };
   SwfdecPlayer *player;
   SwfdecURL *url;
 
commit c7d559e4ef99c11c03e07b212f3189a0490208d9
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu May 22 13:16:19 2008 +0200

    correctly compute the parent path
    
    ... and don't crash if the path is NULL

diff --git a/swfdec/swfdec_url.c b/swfdec/swfdec_url.c
index 14476a6..ec07686 100644
--- a/swfdec/swfdec_url.c
+++ b/swfdec/swfdec_url.c
@@ -223,8 +223,12 @@ swfdec_url_new_parent (const SwfdecURL *url)
   SwfdecURL *ret;
   
   path = g_strdup (url->path);
-  if (path)
-    swfdec_url_path_to_parent_path (path);
+  if (path) {
+    if (!swfdec_url_path_to_parent_path (path)) {
+      g_free (path);
+      path = NULL;
+    }
+  }
   ret = swfdec_url_new_components (url->protocol, url->host, url->port,
       path, NULL);
   g_free (path);
@@ -269,7 +273,7 @@ swfdec_url_new_relative (const SwfdecURL *url, const char *string)
     /* relative URL */
     char *cur = g_strdup (url->path);
     while (g_str_has_prefix (string, "../")) {
-      if (!swfdec_url_path_to_parent_path (cur)) {
+      if (!cur || !swfdec_url_path_to_parent_path (cur)) {
 	g_free (cur);
 	return NULL;
       }
@@ -279,9 +283,13 @@ swfdec_url_new_relative (const SwfdecURL *url, const char *string)
       g_free (cur);
       return NULL;
     }
-    path = g_strconcat (cur, "/", string, NULL);
-    g_free (cur);
-    cur = path;
+    if (cur) {
+      path = g_strconcat (cur, "/", string, NULL);
+      g_free (cur);
+      cur = path;
+    } else {
+      cur = g_strdup (string);
+    }
     query = strchr (cur, '?');
     if (query == NULL) {
       path = *string ? g_strdup (cur) : NULL;


More information about the Swfdec-commits mailing list