Displaying 19 results from an estimated 19 matches for "swfdec_action_wait_for_fram".
Did you mean:
swfdec_action_wait_for_frame
2007 Jan 18
0
Branch 'interpreter' - 2 commits - libswfdec/js libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
..., should be 2", len);
+ return JS_FALSE;
+ }
+ frame = GUINT16_FROM_LE (*((guint16 *) data));
+ if (movie) {
+ swfdec_movie_goto (movie, frame);
+ movie->stopped = TRUE;
+ } else {
+ SWFDEC_ERROR ("no movie to goto on");
+ }
+ return JS_TRUE;
+}
+
+static JSBool
+swfdec_action_wait_for_frame (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ SwfdecMovie *movie = swfdec_action_get_target (cx);
+ guint frame, jump, loaded;
+
+ if (len != 3) {
+ SWFDEC_ERROR ("WaitForFrame action length invalid (is %u, should be 3", len);
+ return JS_TRUE;
+ }
+ if (mo...
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...JSString *string = JS_NewStringCopyZ (cx, s);
- if (string == NULL)
- return JS_FALSE;
- *cx->fp->sp++ = STRING_TO_JSVAL (string);
- return JS_TRUE;
-}
-
-static void
swfdec_value_to_boolean_5 (SwfdecAsContext *cx, jsval val)
{
if (JSVAL_IS_BOOLEAN (val)) {
@@ -407,123 +398,121 @@ swfdec_action_wait_for_frame (SwfdecAsCo
swfdec_script_skip_actions (cx, jump);
}
-#if 0
static void
swfdec_action_constant_pool (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
SwfdecConstantPool *pool;
+ SwfdecAsFrame *frame;
+ frame = cx->frame;
pool = swfdec_constant_pool_new_fr...
2007 Oct 23
0
6 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c libswfdec/swfdec_flash_security.c
..., NULL, swfdec_action_constant_pool, swfdec_action_constant_pool, swfdec_action_constant_pool } },
/* version 3 */
+ [SWFDEC_AS_ACTION_STRICT_MODE] = { "StrictMode", NULL, },
[SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, { swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame } },
[SWFDEC_AS_ACTION_SET_TARGET] = { "SetTarget", swfdec_action_print_set_target, 0, 0, { swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_tar...
2007 Apr 12
0
Branch 'as' - 14 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...uot;ConstantPool", swfdec_action_print_constant_pool, 0, 0, { NULL, NULL, swfdec_action_constant_pool, swfdec_action_constant_pool, swfdec_action_constant_pool } },
/* version 3 */
[SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, { swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame } },
diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_as_types.h
index e96f86c..fbea00c 100644
--- a/libswfdec/swfdec_as_types.h
+++ b/libswfdec/swfdec_as_types.h
@@ -...
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...fdec_action_push_string (JSContext *cx, const char *s)
+{
+ JSString *string = JS_NewStringCopyZ (cx, s);
+ if (string == NULL)
+ return JS_FALSE;
+ *cx->fp->sp++ = STRING_TO_JSVAL (string);
+ return JS_TRUE;
+}
+
/*** ALL THE ACTION IS HERE ***/
static JSBool
@@ -130,9 +198,194 @@ swfdec_action_wait_for_frame (JSContext
return JS_TRUE;
}
+static JSBool
+swfdec_action_constant_pool (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ SwfdecConstantPool *pool;
+
+ pool = swfdec_constant_pool_new_from_action (data, len);
+ if (pool == NULL)
+ return JS_FALSE;
+ if (cx->fp->...
2007 Feb 01
0
Branch 'interpreter' - libswfdec/swfdec_script.c
...sert (script);
+ do {
+ if (pc >= endpc)
+ break;
+ if (*pc & 0x80) {
+ if (pc + 2 >= endpc)
+ break;
+ pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1)));
+ } else {
+ pc++;
+ }
+ } while (jump-- > 0);
+ cx->fp->pc = pc;
+}
+
+static JSBool
+swfdec_action_wait_for_frame2 (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ jsval val;
+ SwfdecMovie *movie;
+
+ if (len != 1) {
+ SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
+ return JS_FALSE;
+ }
+ val = cx->fp->sp[-1];
+ cx->fp->sp--;
+ movie = swfdec_action_ge...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...actions[25
[0x88] = { "ConstantPool", swfdec_action_print_constant_pool, 0, 0, { NULL, NULL, swfdec_action_constant_pool, swfdec_action_constant_pool, swfdec_action_constant_pool } },
/* version 3 */
[0x8a] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, { swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame } },
- [0x8b] = { "SetTarget", NULL, 0, 0, { swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_...
2007 Feb 16
0
11 commits - libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h test/.gitignore test/trace
...;
+}
+
+static JSBool
swfdec_action_bitwise (JSContext *cx, guint action, const guint8 *data, guint len)
{
guint32 a, b;
@@ -2109,7 +2127,7 @@ static const SwfdecActionSpec actions[25
/* version 4 */
[0x8d] = { "WaitForFrame2", swfdec_action_print_wait_for_frame2, 1, 0, { NULL, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2, swfdec_action_wait_for_frame2 } },
/* version 7 */
- [0x8e] = { "DefineFunction2", swfdec_action_print_define_function, 0, -1, { NULL, NULL, NULL, NULL, swfdec_action_define_function } },
+ [0x8e] = { "DefineFuncti...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...ol", swfdec_action_print_constant_pool, 0, 0, swfdec_action_constant_pool, 5 },
+ [SWFDEC_AS_ACTION_STRICT_MODE] = { "StrictMode", NULL, -1, -1, NULL, 5 },
+ /* version 1 */
+ [SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, swfdec_action_wait_for_frame, 1 },
+ [SWFDEC_AS_ACTION_SET_TARGET] = { "SetTarget", swfdec_action_print_set_target, 0, 0, swfdec_action_set_target, 1 },
/* version 3 */
- [SWFDEC_AS_ACTION_STRICT_MODE] = { "StrictMode", NULL, -1, -1, NULL, 3 },
- [SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFra...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...actions[25
[0x88] = { "ConstantPool", swfdec_action_print_constant_pool, 0, 0, { NULL, NULL, swfdec_action_constant_pool, swfdec_action_constant_pool, swfdec_action_constant_pool } },
/* version 3 */
[0x8a] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, { swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame } },
- [0x8b] = { "SetTarget", NULL },
+ [0x8b] = { "SetTarget", NULL, 0, 0, { swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_target,...
2007 Apr 12
0
Branch 'as' - 15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...uot;ConstantPool", swfdec_action_print_constant_pool, 0, 0, { NULL, NULL, swfdec_action_constant_pool, swfdec_action_constant_pool, swfdec_action_constant_pool } },
/* version 3 */
[SWFDEC_AS_ACTION_WAIT_FOR_FRAME] = { "WaitForFrame", swfdec_action_print_wait_for_frame, 0, 0, { swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame, swfdec_action_wait_for_frame } },
-#if 0
- [0x8b] = { "SetTarget", swfdec_action_print_set_target, 0, 0, { swfdec_action_set_target, swfdec_action_set_target, swfdec_action_set_target, swfdec_acti...
2007 Oct 19
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_html_parser.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_text_field_movie.c
...of places when resource != NULL and decoder == NULL
Hopefully this is the right fix
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index b608f31..4f8130c 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -285,7 +285,7 @@ swfdec_action_wait_for_frame (SwfdecAsContext *cx, guint action, const guint8 *d
frame = data[0] || (data[1] << 8);
jump = data[2];
resource = swfdec_movie_get_own_resource (movie);
- if (resource) {
+ if (resource && resource->decoder) {
SwfdecDecoder *dec = resource->decoder;
loaded...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...sert (script);
+ do {
+ if (pc >= endpc)
+ break;
+ if (*pc & 0x80) {
+ if (pc + 2 >= endpc)
+ break;
+ pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1)));
+ } else {
+ pc++;
+ }
+ } while (jump-- > 0);
+ cx->fp->pc = pc;
+}
+
+static JSBool
+swfdec_action_wait_for_frame2 (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ jsval val;
+ SwfdecMovie *movie;
+
+ if (len != 1) {
+ SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
+ return JS_FALSE;
+ }
+ val = cx->fp->sp[-1];
+ cx->fp->sp--;
+ movie = swfdec_action_ge...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...tions */
+ do {
+ if (pc >= endpc)
+ break;
+ if (*pc & 0x80) {
+ if (pc + 2 >= endpc)
+ break;
+ pc += 3 + GUINT16_FROM_LE (*((guint16 *) (pc + 1)));
+ } else {
+ pc++;
+ }
+ } while (jump-- > 0);
+ cx->frame->pc = pc;
+}
+
+#if 0
+static void
+swfdec_action_wait_for_frame2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
+{
+ jsval val;
+ SwfdecMovie *movie;
+
+ if (len != 1) {
+ SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
+ return JS_FALSE;
+ }
+ val = cx->fp->sp[-1];
+ cx->fp->sp--;
+ movie = swfdec_act...
2007 Jun 27
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c
...swfdec_movie_goto (movie, frame);
- movie->stopped = !play;
+ frame = CLAMP (frame, 1, movie->n_frames);
+ swfdec_sprite_movie_goto (movie, frame);
+ movie->playing = play;
}
} else {
SWFDEC_ERROR ("no movie to GotoFrame2 on");
@@ -286,7 +288,7 @@ swfdec_action_wait_for_frame2 (SwfdecAsC
static void
swfdec_action_wait_for_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- SwfdecMovie *movie;
+ SwfdecSpriteMovie *movie;
guint frame, jump, loaded;
if (len != 3) {
@@ -301,8 +303,8 @@ swfdec_action_wait_for_frame (SwfdecAsCo
fram...
2007 Jul 18
0
12 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_playback_alsa.c libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c
...l 18 11:24:49 2007 +0100
make WaitForFrame always succeed when the file is fully loaded
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index d71d948..b04136e 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -285,8 +285,10 @@ swfdec_action_wait_for_frame (SwfdecAsCo
SwfdecDecoder *dec = SWFDEC_MOVIE (movie)->swf->decoder;
loaded = dec->frames_loaded;
g_assert (loaded <= movie->n_frames);
+ if (loaded == dec->frames_total)
+ loaded = G_MAXUINT;
} else {
- loaded = movie->n_frames;
+ loaded = G_MA...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_script_function.c
.../* now set it */
- if (movie) {
+ if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) {
+ SwfdecMovie *movie = SWFDEC_MOVIE (cx->frame->target);
int frame = swfdec_value_to_frame (cx, movie, val);
if (frame >= 0) {
frame += bias;
@@ -252,7 +229,6 @@ static void
swfdec_action_wait_for_frame2 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
jsval val;
- SwfdecMovie *movie;
if (len != 1) {
SWFDEC_ERROR ("WaitForFrame2 needs a 1-byte data");
@@ -260,8 +236,8 @@ swfdec_action_wait_for_frame2 (SwfdecAsC
}
val = cx->fp->sp[-1];
cx...
2007 Oct 18
0
18 commits - doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_flash_security.c
...ce to SwfdecResource
also add convenience function swfdec_movie_get_own_resource()
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index f3133b9..bd8ae18 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -268,25 +268,26 @@ swfdec_action_wait_for_frame2 (SwfdecAsContext *cx, guint action, const guint8 *
static void
swfdec_action_wait_for_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- SwfdecSpriteMovie *movie;
+ SwfdecMovie *movie;
+ SwfdecResource *resource;
guint frame, jump, loaded;
if (len != 3) {...
2007 Nov 07
0
36 commits - doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h
...e gtk-doc documentation of swfdec_sprite_movie_get_frames_loaded() for
what that means.
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index f711e19..1c9f0ee 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -269,32 +269,25 @@ swfdec_action_wait_for_frame2 (SwfdecAsContext *cx, guint action, const guint8 *
static void
swfdec_action_wait_for_frame (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- SwfdecMovie *movie;
- SwfdecResource *resource;
- guint frame, jump, loaded;
+ SwfdecSpriteMovie *movie;
+ guint jump;
+ int...