[Swfdec] 2 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_resource.c

Benjamin Otte company at kemper.freedesktop.org
Thu Nov 1 15:07:47 PDT 2007


 libswfdec/swfdec_as_date.c  |    8 +++-----
 libswfdec/swfdec_resource.c |    1 +
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 98a14082ea7f53ff9a4b87410b08956f7a36df87
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Nov 1 23:07:42 2007 +0100

    use swfdec_as_context_get_time(), not gettimeofday()

diff --git a/libswfdec/swfdec_as_date.c b/libswfdec/swfdec_as_date.c
index 691301d..1029d44 100644
--- a/libswfdec/swfdec_as_date.c
+++ b/libswfdec/swfdec_as_date.c
@@ -24,8 +24,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <sys/time.h>
-#include <time.h>
 #include <math.h>
 
 #include "swfdec_as_date.h"
@@ -1049,11 +1047,11 @@ swfdec_as_date_construct (SwfdecAsContext *cx, SwfdecAsObject *object,
 
   if (argc == 0) // current time, local
   {
-    struct timeval tp;
+    GTimeVal tv;
 
-    gettimeofday (&tp, NULL);
+    swfdec_as_context_get_time (cx, &tv);
     swfdec_as_date_set_milliseconds_local (date,
-	tp.tv_sec * 1000 + tp.tv_usec / 1000);
+	tv.tv_sec * 1000 + tv.tv_usec / 1000);
   }
   else if (argc == 1) // milliseconds from epoch, local
   {
commit f40dbbf3642e547628718a5867b2c41dfe60eae9
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Nov 1 23:07:07 2007 +0100

    fix memleak that could cause asserts on cleanup

diff --git a/libswfdec/swfdec_resource.c b/libswfdec/swfdec_resource.c
index 8560608..fe52207 100644
--- a/libswfdec/swfdec_resource.c
+++ b/libswfdec/swfdec_resource.c
@@ -330,6 +330,7 @@ swfdec_resource_do_load (SwfdecPlayer *player, SwfdecLoader *loader, gpointer ta
   if (movie == NULL) {
     movie = swfdec_player_create_movie_at_level (player, resource, level);
     mov = SWFDEC_MOVIE (movie);
+    g_object_unref (resource);
   } else {
     mov = SWFDEC_MOVIE (movie);
     swfdec_sprite_movie_unload (movie);


More information about the Swfdec mailing list