[Swfdec] 2 commits - libswfdec/swfdec_script.c test/swfdec-extract.c

Benjamin Otte company at kemper.freedesktop.org
Mon Feb 19 14:08:10 PST 2007


 libswfdec/swfdec_script.c |    3 +++
 test/swfdec-extract.c     |    8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
diff-tree ba5327ffe305de547d40a282a1d866a2cf9e992e (from 842b4b558af7b8ad68f47fd7473989fc46fd23d6)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Feb 19 23:06:14 2007 +0100

    Add a warning in CallMethod if a function doesn't exist

diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 824861b..f8a9623 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -675,6 +675,9 @@ swfdec_action_call_method (JSContext *cx
   } else {
     if (!JS_GetProperty (cx, obj, s, &fun))
       return JS_FALSE;
+    if (!JSVAL_IS_OBJECT (fun)) {
+      SWFDEC_WARNING ("%s:%s is not a function", JS_GetClass (obj)->name, s);
+    }
   }
   fp->sp--;
   fp->sp[-1] = fun;
diff-tree 842b4b558af7b8ad68f47fd7473989fc46fd23d6 (from 185d07d2ed05ec0bf1970484d27642703177702e)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Feb 19 20:56:52 2007 +0100

    Add missing \n to print statements

diff --git a/test/swfdec-extract.c b/test/swfdec-extract.c
index 47e8234..da0964b 100644
--- a/test/swfdec-extract.c
+++ b/test/swfdec-extract.c
@@ -68,7 +68,7 @@ export_sound (SwfdecSound *sound, const 
   SwfdecBuffer *wav;
 
   if (sound->decoded == NULL) {
-    g_printerr ("not a sound event. For streams use the sprite.");
+    g_printerr ("not a sound event. For extraction of streams extract the sprite.\n");
     return FALSE;
   }
   wav = encode_wav (sound->decoded);
@@ -97,7 +97,7 @@ export_sprite_sound (SwfdecSprite *sprit
       break;
   }
   if (i >= sprite->n_frames) {
-    g_printerr ("No sound in sprite %u", SWFDEC_CHARACTER (sprite)->id);
+    g_printerr ("No sound in sprite %u\n", SWFDEC_CHARACTER (sprite)->id);
     return FALSE;
   }
   audio = swfdec_audio_stream_new (NULL, sprite, i);
@@ -185,11 +185,11 @@ export_graphic (SwfdecGraphic *graphic, 
   const SwfdecColorTransform trans = { 256, 0, 256, 0, 256, 0, 256, 0 };
 
   if (SWFDEC_IS_SPRITE (graphic)) {
-    g_printerr ("Sprites can not be exported");
+    g_printerr ("Sprites can not be exported\n");
     return FALSE;
   }
   if (SWFDEC_IS_BUTTON (graphic)) {
-    g_printerr ("Buttons can not be exported");
+    g_printerr ("Buttons can not be exported\n");
     return FALSE;
   }
   width = ceil (graphic->extents.x1 / SWFDEC_TWIPS_SCALE_FACTOR) 


More information about the Swfdec mailing list