[Swfdec] 7 commits - configure.ac libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Wed Nov 28 07:21:09 PST 2007


 configure.ac                                 |    7 ++-
 libswfdec/swfdec_movie.c                     |   57 ++++++++++-----------------
 libswfdec/swfdec_movie.h                     |    3 -
 libswfdec/swfdec_sprite_movie.c              |    4 -
 test/trace/Makefile.am                       |   18 ++++++++
 test/trace/remove-child-onUnload-5.swf       |binary
 test/trace/remove-child-onUnload-5.swf.trace |    4 +
 test/trace/remove-child-onUnload-6.swf       |binary
 test/trace/remove-child-onUnload-6.swf.trace |    6 ++
 test/trace/remove-child-onUnload-7.swf       |binary
 test/trace/remove-child-onUnload-7.swf.trace |    6 ++
 test/trace/remove-child-onUnload-8.swf       |binary
 test/trace/remove-child-onUnload-8.swf.trace |    6 ++
 test/trace/remove-child-onUnload.as          |   13 ++++++
 test/trace/remove-with-onUnload-5.swf        |binary
 test/trace/remove-with-onUnload-5.swf.trace  |    7 +++
 test/trace/remove-with-onUnload-6.swf        |binary
 test/trace/remove-with-onUnload-6.swf.trace  |   25 +++++++++++
 test/trace/remove-with-onUnload-7.swf        |binary
 test/trace/remove-with-onUnload-7.swf.trace  |   25 +++++++++++
 test/trace/remove-with-onUnload-8.swf        |binary
 test/trace/remove-with-onUnload-8.swf.trace  |   25 +++++++++++
 test/trace/remove-with-onUnload.as           |   26 ++++++++++++
 test/trace/trace.c                           |    1 
 24 files changed, 193 insertions(+), 40 deletions(-)

New commits:
commit 762a86e6d652701ed6bcce4165b4f9f87448ba13
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 12:58:00 2007 +0100

    add a test where only a child of the removed movie has an onUnload function

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index a0a6cb7..091618c 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1970,6 +1970,15 @@ EXTRA_DIST = \
 	remote-lso-usage-properties-7.swf.trace \
 	remote-lso-usage-properties-8.swf \
 	remote-lso-usage-properties-8.swf.trace \
+	remove-child-onUnload.as \
+	remove-child-onUnload-5.swf \
+	remove-child-onUnload-5.swf.trace \
+	remove-child-onUnload-6.swf \
+	remove-child-onUnload-6.swf.trace \
+	remove-child-onUnload-7.swf \
+	remove-child-onUnload-7.swf.trace \
+	remove-child-onUnload-8.swf \
+	remove-child-onUnload-8.swf.trace \
 	remove-depths.as \
 	remove-depths-5.swf \
 	remove-depths-5.swf.trace \
diff --git a/test/trace/remove-child-onUnload-5.swf b/test/trace/remove-child-onUnload-5.swf
new file mode 100644
index 0000000..f55f3dd
Binary files /dev/null and b/test/trace/remove-child-onUnload-5.swf differ
diff --git a/test/trace/remove-child-onUnload-5.swf.trace b/test/trace/remove-child-onUnload-5.swf.trace
new file mode 100644
index 0000000..45952c9
--- /dev/null
+++ b/test/trace/remove-child-onUnload-5.swf.trace
@@ -0,0 +1,4 @@
+: 
+: 
+: 
+===
diff --git a/test/trace/remove-child-onUnload-6.swf b/test/trace/remove-child-onUnload-6.swf
new file mode 100644
index 0000000..e1d909a
Binary files /dev/null and b/test/trace/remove-child-onUnload-6.swf differ
diff --git a/test/trace/remove-child-onUnload-6.swf.trace b/test/trace/remove-child-onUnload-6.swf.trace
new file mode 100644
index 0000000..953cc4d
--- /dev/null
+++ b/test/trace/remove-child-onUnload-6.swf.trace
@@ -0,0 +1,6 @@
+_level0.a: -32769
+: 
+_level0.a.b: 1
+===
+_level0.a.b
+_level0.a
diff --git a/test/trace/remove-child-onUnload-7.swf b/test/trace/remove-child-onUnload-7.swf
new file mode 100644
index 0000000..0c9e5ac
Binary files /dev/null and b/test/trace/remove-child-onUnload-7.swf differ
diff --git a/test/trace/remove-child-onUnload-7.swf.trace b/test/trace/remove-child-onUnload-7.swf.trace
new file mode 100644
index 0000000..69f1099
--- /dev/null
+++ b/test/trace/remove-child-onUnload-7.swf.trace
@@ -0,0 +1,6 @@
+_level0.a: -32769
+undefined: undefined
+_level0.a.b: 1
+===
+_level0.a.b
+_level0.a
diff --git a/test/trace/remove-child-onUnload-8.swf b/test/trace/remove-child-onUnload-8.swf
new file mode 100644
index 0000000..ebfee90
Binary files /dev/null and b/test/trace/remove-child-onUnload-8.swf differ
diff --git a/test/trace/remove-child-onUnload-8.swf.trace b/test/trace/remove-child-onUnload-8.swf.trace
new file mode 100644
index 0000000..69f1099
--- /dev/null
+++ b/test/trace/remove-child-onUnload-8.swf.trace
@@ -0,0 +1,6 @@
+_level0.a: -32769
+undefined: undefined
+_level0.a.b: 1
+===
+_level0.a.b
+_level0.a
diff --git a/test/trace/remove-child-onUnload.as b/test/trace/remove-child-onUnload.as
new file mode 100644
index 0000000..8106848
--- /dev/null
+++ b/test/trace/remove-child-onUnload.as
@@ -0,0 +1,13 @@
+// makeswf -v 7 -s 200x150 -r 1 -o remove-child-onUnload.swf remove-child-onUnload.as
+
+createEmptyMovieClip ("a", 0);
+a.createEmptyMovieClip ("a", 0);
+a.createEmptyMovieClip ("b", 1);
+a.b.onUnload = function () { trace (this); trace (this._parent); };
+a.removeMovieClip ();
+trace (a + ": " + a.getDepth ());
+trace (a.a + ": " + a.a.getDepth ());
+trace (a.b + ": " + a.b.getDepth ());
+trace ("===");
+
+loadMovie ("fscommand:quit", "");
commit 9bf200f0eb22d8febcac51b0fe40c032389ba7ab
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 12:54:00 2007 +0100

    add test for remove stuff

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 8c9770d..a0a6cb7 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1988,6 +1988,15 @@ EXTRA_DIST = \
 	remove-movie-7.swf.trace \
 	remove-movie-8.swf \
 	remove-movie-8.swf.trace \
+	remove-with-onUnload.as \
+	remove-with-onUnload-5.swf \
+	remove-with-onUnload-5.swf.trace \
+	remove-with-onUnload-6.swf \
+	remove-with-onUnload-6.swf.trace \
+	remove-with-onUnload-7.swf \
+	remove-with-onUnload-7.swf.trace \
+	remove-with-onUnload-8.swf \
+	remove-with-onUnload-8.swf.trace \
 	removesprite-depths.as \
 	removesprite-depths-5.swf \
 	removesprite-depths-5.swf.trace \
diff --git a/test/trace/remove-with-onUnload-5.swf b/test/trace/remove-with-onUnload-5.swf
new file mode 100644
index 0000000..bb23f7b
Binary files /dev/null and b/test/trace/remove-with-onUnload-5.swf differ
diff --git a/test/trace/remove-with-onUnload-5.swf.trace b/test/trace/remove-with-onUnload-5.swf.trace
new file mode 100644
index 0000000..0651736
--- /dev/null
+++ b/test/trace/remove-with-onUnload-5.swf.trace
@@ -0,0 +1,7 @@
+>> _level0
+: 
+: 
+: 
+: 
+: 
+===
diff --git a/test/trace/remove-with-onUnload-6.swf b/test/trace/remove-with-onUnload-6.swf
new file mode 100644
index 0000000..23ef1d9
Binary files /dev/null and b/test/trace/remove-with-onUnload-6.swf differ
diff --git a/test/trace/remove-with-onUnload-6.swf.trace b/test/trace/remove-with-onUnload-6.swf.trace
new file mode 100644
index 0000000..1fe526a
--- /dev/null
+++ b/test/trace/remove-with-onUnload-6.swf.trace
@@ -0,0 +1,25 @@
+>> _level0
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+: 
+_level0.a.d: 3
+===
+>> _level0.a.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+: 
+_level0.a.d: 3
+>> _level0.a.b
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+: 
+_level0.a.d: 3
+>> _level0.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+: 
+_level0.a.d: 3
diff --git a/test/trace/remove-with-onUnload-7.swf b/test/trace/remove-with-onUnload-7.swf
new file mode 100644
index 0000000..6ab25e3
Binary files /dev/null and b/test/trace/remove-with-onUnload-7.swf differ
diff --git a/test/trace/remove-with-onUnload-7.swf.trace b/test/trace/remove-with-onUnload-7.swf.trace
new file mode 100644
index 0000000..d3f3d55
--- /dev/null
+++ b/test/trace/remove-with-onUnload-7.swf.trace
@@ -0,0 +1,25 @@
+>> _level0
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+===
+>> _level0.a.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+>> _level0.a.b
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+>> _level0.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
diff --git a/test/trace/remove-with-onUnload-8.swf b/test/trace/remove-with-onUnload-8.swf
new file mode 100644
index 0000000..3c26206
Binary files /dev/null and b/test/trace/remove-with-onUnload-8.swf differ
diff --git a/test/trace/remove-with-onUnload-8.swf.trace b/test/trace/remove-with-onUnload-8.swf.trace
new file mode 100644
index 0000000..d3f3d55
--- /dev/null
+++ b/test/trace/remove-with-onUnload-8.swf.trace
@@ -0,0 +1,25 @@
+>> _level0
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+===
+>> _level0.a.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+>> _level0.a.b
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
+>> _level0.a
+_level0.a: -32769
+_level0.a.a: 0
+_level0.a.b: 1
+undefined: undefined
+_level0.a.d: 3
diff --git a/test/trace/remove-with-onUnload.as b/test/trace/remove-with-onUnload.as
new file mode 100644
index 0000000..e91b606
--- /dev/null
+++ b/test/trace/remove-with-onUnload.as
@@ -0,0 +1,26 @@
+// makeswf -v 7 -s 200x150 -r 1 -o remove-with-onUnload.swf remove-with-onUnload.as
+
+function foo () {
+  trace (">> " + this);
+  trace (_root.a + ": " + _root.a.getDepth ());
+  trace (_root.a.a + ": " + _root.a.a.getDepth ());
+  trace (_root.a.b + ": " + _root.a.b.getDepth ());
+  trace (_root.a.c + ": " + _root.a.c.getDepth ());
+  trace (_root.a.d + ": " + _root.a.d.getDepth ());
+};
+createEmptyMovieClip ("a", 0);
+a.createEmptyMovieClip ("a", 0);
+a.createEmptyMovieClip ("b", 1);
+a.createEmptyMovieClip ("c", 2);
+a.createEmptyMovieClip ("d", 3);
+a.onUnload = foo;
+a.a.onUnload = foo;
+a.b.onUnload = foo;
+a.c.removeMovieClip ();
+a.removeMovieClip ();
+a.removeMovieClip ();
+a.d.removeMovieClip ();
+foo ();
+trace ("===");
+
+loadMovie ("fscommand:quit", "");
commit 650e5132b2cf2002302930d051783f0ca2495191
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 12:50:44 2007 +0100

    make movie deletion work properly

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 856443c..1e1e841 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -254,7 +254,7 @@ swfdec_movie_find (SwfdecMovie *movie, int depth)
 }
 
 static gboolean
-swfdec_movie_do_remove (SwfdecMovie *movie)
+swfdec_movie_do_remove (SwfdecMovie *movie, gboolean destroy)
 {
   SwfdecPlayer *player;
 
@@ -267,7 +267,7 @@ swfdec_movie_do_remove (SwfdecMovie *movie)
       walk = walk->next;
     if (walk == NULL)
       break;
-    swfdec_movie_remove (walk->data);
+    destroy &= swfdec_movie_do_remove (walk->data, destroy);
   }
   /* FIXME: all of this here or in destroy callback? */
   if (player->mouse_grab == movie)
@@ -275,16 +275,17 @@ swfdec_movie_do_remove (SwfdecMovie *movie)
   if (player->mouse_drag == movie)
     player->mouse_drag = NULL;
   swfdec_movie_invalidate (movie);
-  swfdec_movie_set_depth (movie, -32769 - movie->depth); /* don't ask me why... */
+  movie->state = SWFDEC_MOVIE_STATE_REMOVED;
 
   if ((movie->events && 
 	swfdec_event_list_has_conditions (movie->events, SWFDEC_AS_OBJECT (movie), SWFDEC_EVENT_UNLOAD, 0)) ||
       swfdec_as_object_has_function (SWFDEC_AS_OBJECT (movie), SWFDEC_AS_STR_onUnload)) {
     swfdec_movie_queue_script (movie, SWFDEC_EVENT_UNLOAD);
-    return FALSE;
-  } else {
-    return TRUE;
+    destroy = FALSE;
   }
+  if (destroy)
+    swfdec_movie_destroy (movie);
+  return destroy;
 }
 
 /**
@@ -298,16 +299,14 @@ swfdec_movie_do_remove (SwfdecMovie *movie)
 void
 swfdec_movie_remove (SwfdecMovie *movie)
 {
-  gboolean result;
-
   g_return_if_fail (SWFDEC_IS_MOVIE (movie));
 
   if (movie->state > SWFDEC_MOVIE_STATE_RUNNING)
     return;
-  result = swfdec_movie_do_remove (movie);
-  movie->state = SWFDEC_MOVIE_STATE_REMOVED;
-  if (result)
-    swfdec_movie_destroy (movie);
+  if (swfdec_movie_do_remove (movie, TRUE))
+    return;
+  
+  swfdec_movie_set_depth (movie, -32769 - movie->depth); /* don't ask me why... */
 }
 
 /**
@@ -325,9 +324,6 @@ swfdec_movie_destroy (SwfdecMovie *movie)
   SwfdecPlayer *player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context);
 
   g_assert (movie->state < SWFDEC_MOVIE_STATE_DESTROYED);
-  if (movie->state < SWFDEC_MOVIE_STATE_REMOVED) {
-    swfdec_movie_do_remove (movie);
-  }
   SWFDEC_LOG ("destroying movie %s", movie->name);
   while (movie->list) {
     swfdec_movie_destroy (movie->list->data);
commit 5c73e2054034d08dd52d08f5670db2e388dcd027
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 11:52:54 2007 +0100

    make glib warnings always fatal

diff --git a/test/trace/trace.c b/test/trace/trace.c
index 55276d7..40f96af 100644
--- a/test/trace/trace.c
+++ b/test/trace/trace.c
@@ -211,6 +211,7 @@ main (int argc, char **argv)
   GThreadPool *pool;
   GError *error = NULL;
 
+  g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
   g_thread_init (NULL);
   /* by default get rid of the loads of warnings the tests produce */
   g_setenv ("SWFDEC_DEBUG", "2", FALSE);
commit 6c5f74ac52e60d861bd7bba83efc4eda2607a17e
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 11:33:25 2007 +0100

    make swfdec_movie_queue_script not return TRUE/FALSE
    
    instead, check for availability of an unload event when removing a movie

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index d529d01..856443c 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -277,7 +277,14 @@ swfdec_movie_do_remove (SwfdecMovie *movie)
   swfdec_movie_invalidate (movie);
   swfdec_movie_set_depth (movie, -32769 - movie->depth); /* don't ask me why... */
 
-  return !swfdec_movie_queue_script (movie, SWFDEC_EVENT_UNLOAD);
+  if ((movie->events && 
+	swfdec_event_list_has_conditions (movie->events, SWFDEC_AS_OBJECT (movie), SWFDEC_EVENT_UNLOAD, 0)) ||
+      swfdec_as_object_has_function (SWFDEC_AS_OBJECT (movie), SWFDEC_AS_STR_onUnload)) {
+    swfdec_movie_queue_script (movie, SWFDEC_EVENT_UNLOAD);
+    return FALSE;
+  } else {
+    return TRUE;
+  }
 }
 
 /**
@@ -447,20 +454,17 @@ swfdec_movie_execute (SwfdecMovie *movie, SwfdecEventType condition)
  * @condition: the event that should happen
  *
  * Queues execution of all scripts associated with the given event.
- *
- * Returns: TRUE if there were any such events
  **/
-gboolean
+void
 swfdec_movie_queue_script (SwfdecMovie *movie, SwfdecEventType condition)
 {
   SwfdecPlayer *player;
-  gboolean ret = FALSE;
   guint importance;
   
-  g_return_val_if_fail (SWFDEC_IS_MOVIE (movie), FALSE);
+  g_return_if_fail (SWFDEC_IS_MOVIE (movie));
 
   if (!SWFDEC_IS_SPRITE_MOVIE (movie))
-    return FALSE;
+    return;
 
   switch (condition) {
     case SWFDEC_EVENT_INITIALIZE:
@@ -489,23 +493,11 @@ swfdec_movie_queue_script (SwfdecMovie *movie, SwfdecEventType condition)
       importance = 2;
       break;
     default:
-      g_return_val_if_reached (FALSE);
-  }
-
-  if (movie->events &&
-      swfdec_event_list_has_conditions (movie->events, 
-	  SWFDEC_AS_OBJECT (movie), condition, 0)) {
-      ret = TRUE;
-  } else {
-    const char *name = swfdec_event_type_get_name (condition);
-    if (name != NULL &&
-	swfdec_as_object_has_function (SWFDEC_AS_OBJECT (movie), name))
-      ret = TRUE;
+      g_return_if_reached ();
   }
 
   player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context);
   swfdec_player_add_action (player, movie, condition, importance);
-  return ret;
 }
 
 /* NB: coordinates are in movie's coordiante system. Use swfdec_movie_get_mouse
diff --git a/libswfdec/swfdec_movie.h b/libswfdec/swfdec_movie.h
index 363d4b1..183e022 100644
--- a/libswfdec/swfdec_movie.h
+++ b/libswfdec/swfdec_movie.h
@@ -271,7 +271,7 @@ SwfdecMovie *	swfdec_movie_resolve		(SwfdecMovie *		movie);
 guint		swfdec_movie_get_version	(SwfdecMovie *		movie);
 void		swfdec_movie_execute		(SwfdecMovie *		movie,
 						 SwfdecEventType	condition);
-gboolean      	swfdec_movie_queue_script	(SwfdecMovie *		movie,
+void		swfdec_movie_queue_script	(SwfdecMovie *		movie,
   						 SwfdecEventType	condition);
 void		swfdec_movie_load_variables	(SwfdecMovie *		movie,
 						 const char *		url,
commit f850ef180f3ee7a769967fb2cad0dffbf1c09e24
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 10:22:28 2007 +0100

    get rid of will_be_removed member and replace it with checking state

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 2829f46..d529d01 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -261,10 +261,9 @@ swfdec_movie_do_remove (SwfdecMovie *movie)
   SWFDEC_LOG ("removing %s %s", G_OBJECT_TYPE_NAME (movie), movie->name);
 
   player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context);
-  movie->will_be_removed = TRUE;
   while (movie->list) {
     GList *walk = movie->list;
-    while (walk && SWFDEC_MOVIE (walk->data)->will_be_removed)
+    while (walk && SWFDEC_MOVIE (walk->data)->state >= SWFDEC_MOVIE_STATE_REMOVED)
       walk = walk->next;
     if (walk == NULL)
       break;
@@ -422,7 +421,7 @@ swfdec_movie_execute (SwfdecMovie *movie, SwfdecEventType condition)
       return;
     swfdec_movie_set_constructor (SWFDEC_SPRITE_MOVIE (movie));
   } else if (condition == SWFDEC_EVENT_ENTER) {
-    if (movie->will_be_removed)
+    if (movie->state >= SWFDEC_MOVIE_STATE_REMOVED)
       return;
   }
 
diff --git a/libswfdec/swfdec_movie.h b/libswfdec/swfdec_movie.h
index eed156a..363d4b1 100644
--- a/libswfdec/swfdec_movie.h
+++ b/libswfdec/swfdec_movie.h
@@ -145,7 +145,6 @@ struct _SwfdecMovie {
 
   /* iteration state */
   gboolean		visible;		/* whether we currently can be seen or iterate */
-  gboolean		will_be_removed;	/* it's known that this movie will not survive the next iteration */
 
   /* drawing state */
   SwfdecMovie *		mask_of;		/* movie this movie is a mask of or NULL if none */
diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index 1a7b6d5..a9f99a7 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -518,7 +518,7 @@ swfdec_sprite_movie_goto (SwfdecSpriteMovie *movie, guint goto_frame)
   mov = SWFDEC_MOVIE (movie);
   /* lots of things where we've got nothing to do */
   if (goto_frame == 0 || goto_frame > movie->n_frames || 
-      movie->sprite == NULL || mov->will_be_removed || goto_frame == movie->frame)
+      movie->sprite == NULL || mov->state >= SWFDEC_MOVIE_STATE_REMOVED || goto_frame == movie->frame)
     return;
 
   if (goto_frame > movie->sprite->parse_frame) {
@@ -656,7 +656,7 @@ swfdec_sprite_movie_iterate (SwfdecMovie *mov)
   SwfdecPlayer *player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (mov)->context);
   guint goto_frame;
 
-  if (mov->will_be_removed)
+  if (mov->state >= SWFDEC_MOVIE_STATE_REMOVED)
     return;
 
   if (movie->sprite && movie->frame == (guint) -1)
commit 63da3f31bc7d76abedcacd091fda1ddb63a64aef
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Nov 27 09:32:19 2007 +0100

    test for mad with pkg-config before trying it with AC_CHECK_LIB

diff --git a/configure.ac b/configure.ac
index 924aa4d..bb86e8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,7 +206,12 @@ AC_ARG_ENABLE(mad,
 	enable_mad="no")
 
 if test "$enable_mad" = "yes"; then
-	AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no")
+        PKG_CHECK_EXISTS([mad],[
+		MAD_VER=0.15.0
+                PKG_CHECK_MODULES(MAD, mad >= $MAD_VER mad >= $MAD_VER, HAVE_MAD=yes, HAVE_MAD=no)
+        ], [
+                AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no")
+        ])
 	AC_SUBST(MAD_LIBS)
 	if test "x$HAVE_MAD" = xyes; then
 	  AC_DEFINE(HAVE_MAD, 1, [Define if mad is enabled])


More information about the Swfdec mailing list