[Swfdec] 3 commits - configure.ac libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite_movie_as.c README

Benjamin Otte company at kemper.freedesktop.org
Tue Nov 13 04:01:54 PST 2007


 README                             |    2 +-
 configure.ac                       |    4 ++--
 libswfdec/swfdec_sprite.c          |   15 +++++++--------
 libswfdec/swfdec_sprite_movie_as.c |    8 ++++++--
 4 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 53e074fa803c2184a4a3eb808a8c856314150f93
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 13 12:52:46 2007 +0100

    call onLoad, onConstruct and onInitialize in attachMovie

diff --git a/libswfdec/swfdec_sprite_movie_as.c b/libswfdec/swfdec_sprite_movie_as.c
index 0f8d4c6..158468f 100644
--- a/libswfdec/swfdec_sprite_movie_as.c
+++ b/libswfdec/swfdec_sprite_movie_as.c
@@ -368,6 +368,11 @@ swfdec_sprite_movie_init_from_object (SwfdecMovie *movie,
 	swfdec_sprite_movie_foreach_copy_properties, SWFDEC_AS_OBJECT (movie));
   }
 
+  if (SWFDEC_IS_SPRITE_MOVIE (movie)) {
+    swfdec_movie_queue_script (movie, SWFDEC_EVENT_INITIALIZE);
+    swfdec_movie_queue_script (movie, SWFDEC_EVENT_LOAD);
+    swfdec_movie_execute (movie, SWFDEC_EVENT_CONSTRUCT);
+  }
   swfdec_movie_initialize (movie);
 }
 
@@ -383,7 +388,7 @@ swfdec_sprite_movie_attachMovie (SwfdecAsContext *cx, SwfdecAsObject *object,
   int depth;
   SwfdecGraphic *sprite;
 
-  SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, (gpointer)&movie, "ss", &export, &name);
+  SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, (gpointer)&movie, "ssi", &export, &name, &depth);
 
   if (argc > 3 && SWFDEC_AS_VALUE_IS_OBJECT (&argv[3])) {
     initObject = SWFDEC_AS_VALUE_GET_OBJECT ((&argv[3]));
@@ -399,7 +404,6 @@ swfdec_sprite_movie_attachMovie (SwfdecAsContext *cx, SwfdecAsObject *object,
     }
     return;
   }
-  depth = swfdec_as_value_to_integer (cx, &argv[2]);
   if (swfdec_depth_classify (depth) == SWFDEC_DEPTH_CLASS_EMPTY)
     return;
   ret = swfdec_movie_find (movie, depth);
commit 1f792590fd694ccda1e7195043d39319afb8d34a
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 13 12:03:12 2007 +0100

    a sprite with 0 frames does have 0 frames

diff --git a/libswfdec/swfdec_sprite.c b/libswfdec/swfdec_sprite.c
index 51a9b0f..e81c688 100644
--- a/libswfdec/swfdec_sprite.c
+++ b/libswfdec/swfdec_sprite.c
@@ -202,15 +202,14 @@ swfdec_sprite_set_n_frames (SwfdecSprite *sprite, guint n_frames,
   guint i;
 
   g_return_if_fail (SWFDEC_IS_SPRITE (sprite));
-  if (n_frames == 0)
-    n_frames = 1;
+  if (n_frames > 0) {
+    sprite->frames = g_new0 (SwfdecSpriteFrame, n_frames);
+    sprite->n_frames = n_frames;
 
-  sprite->frames = g_new0 (SwfdecSpriteFrame, n_frames);
-  sprite->n_frames = n_frames;
-
-  if (rate > 0) {
-    for (i = 0; i < n_frames; i++) {
-      sprite->frames[i].sound_samples = 44100 * 256 / rate;
+    if (rate > 0) {
+      for (i = 0; i < n_frames; i++) {
+	sprite->frames[i].sound_samples = 44100 * 256 / rate;
+      }
     }
   }
 
commit 4a2c3ac6329d11003c9c0b51a100f89eeb846bcc
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 13 12:03:01 2007 +0100

    PNG image loading requires cairo-png

diff --git a/README b/README
index 1649a30..db45aaa 100644
--- a/README
+++ b/README
@@ -61,7 +61,7 @@ Limitations:
 
 Dependencies:
 
-  cairo (>= 1.2.0 - >= 1.4.0 recommended)
+  cairo (>= 1.2.0 - >= 1.4.0 recommended) with png support enabled
   glib (>= 2.10.0)
   liboil (>= 0.3.6)
   Pangocairo (aka Pango with cairo support)
diff --git a/configure.ac b/configure.ac
index 882a129..7abf6e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,11 +191,11 @@ if test "$HAVE_LIBOIL" = "no"; then
 fi
 
 CAIRO_VER=1.2.0
-PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)
+PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER cairo-png >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)
 AC_SUBST(CAIRO_LIBS)
 AC_SUBST(CAIRO_CFLAGS)
 if test "$HAVE_CAIRO" = "no"; then
-  AC_MSG_ERROR([cairo >= $CAIRO_VER is required to build swfdec])
+  AC_MSG_ERROR([cairo and cairo-png = $CAIRO_VER is required to build swfdec])
 fi
 
 AC_ARG_ENABLE(mad,


More information about the Swfdec mailing list