[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/sp...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_root.cpp server/sp... |
Date: |
Thu, 07 Dec 2006 11:52:39 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/07 11:52:39
Modified files:
. : ChangeLog
server : movie_root.cpp sprite_instance.cpp
utilities : processor.cpp
Log message:
* server/: movie_root.cpp, sprite_instance.cpp:
Added debugging output.
* utilities/processor.cpp: don't always kick
a STOPPED movie, wait for a specified number
of seconds before kicking it (defaults to 5).
Fixes bug #18475.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1873&r2=1.1874
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.41&r2=1.42
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1873
retrieving revision 1.1874
diff -u -b -r1.1873 -r1.1874
--- ChangeLog 7 Dec 2006 10:46:12 -0000 1.1873
+++ ChangeLog 7 Dec 2006 11:52:39 -0000 1.1874
@@ -1,5 +1,14 @@
2006-12-07 Sandro Santilli <address@hidden>
+ * server/: movie_root.cpp, sprite_instance.cpp:
+ Added debugging output.
+ * utilities/processor.cpp: don't always kick
+ a STOPPED movie, wait for a specified number
+ of seconds before kicking it (defaults to 5).
+ Fixes bug #18475.
+
+2006-12-07 Sandro Santilli <address@hidden>
+
* server/: edit_text_character.cpp, movie_root.cpp,
movie_root.h: streamlined headers inclusions.
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/movie_root.cpp 7 Dec 2006 10:46:12 -0000 1.33
+++ server/movie_root.cpp 7 Dec 2006 11:52:39 -0000 1.34
@@ -24,9 +24,6 @@
#include <pthread.h>
#endif
-#include <iostream>
-#include <string>
-
#include "movie_root.h"
#include "log.h"
#include "sprite_instance.h"
@@ -34,6 +31,9 @@
#include "render.h"
#include "VM.h"
+#include <iostream>
+#include <string>
+#include <typeinfo>
#include <cassert>
using namespace std;
@@ -441,8 +441,25 @@
}
}
+#ifdef GNASH_DEBUG
+ size_t totframes = _movie->get_frame_count();
+ size_t prevframe = _movie->get_current_frame();
+#endif
+
_movie->advance(delta_time);
+#ifdef GNASH_DEBUG
+ size_t curframe = _movie->get_current_frame();
+
+ log_msg("movie_root::advance advanced top-level movie from "
+ SIZET_FMT "/" SIZET_FMT
+ " to " SIZET_FMT "/" SIZET_FMT
+ " (_movie is %s%s)",
+ prevframe, totframes, curframe, totframes,
+ typeid(*_movie).name(),
+ _movie->get_play_state() == sprite_instance::STOP ? " -
now in STOP mode" : "");
+#endif
+
assert(testInvariant());
}
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- server/sprite_instance.cpp 6 Dec 2006 12:48:51 -0000 1.96
+++ server/sprite_instance.cpp 7 Dec 2006 11:52:39 -0000 1.97
@@ -1780,13 +1780,28 @@
size_t frame_count = m_def->get_frame_count();
+#ifdef GNASH_DEBUG
+ log_msg("sprite_instance::advance_sprite is at frame %u/%u",
m_current_frame, frame_count);
+#endif
+
// Update current and next frames.
if (m_play_state == PLAY)
{
+#ifdef GNASH_DEBUG
+ log_msg("sprite_instance::advance_sprite we're in PLAY mode");
+#endif
+
int prev_frame = m_current_frame;
+
if (m_on_event_load_called)
{
+#ifdef GNASH_DEBUG
+ log_msg(" on_event_load called, incrementing");
+#endif
increment_frame_and_check_for_loop();
+#ifdef GNASH_DEBUG
+ log_msg(" after increment we are at frame %u/%u",
m_current_frame, frame_count);
+#endif
}
// Execute the current frame's tags.
@@ -1824,14 +1839,30 @@
execute_frame_tags(m_current_frame);
}
}
+#ifdef GNASH_DEBUG
+ else
+ {
+ log_msg("sprite_instance::advance_sprite we're in STOP mode");
+ }
+#endif
do_actions();
+#ifdef GNASH_DEBUG
+ log_msg(" advancing display list (we always do that!)");
+#endif
+
// Advance everything in the display list.
m_display_list.advance(delta_time);
+ if ( ! m_goto_frame_action_list.empty() )
+ {
+#ifdef GNASH_DEBUG
+ log_msg(" Executing %u actions in goto_Frame_action_list",
m_goto_frame_action_list.size());
+#endif
execute_actions(m_goto_frame_action_list);
assert(m_goto_frame_action_list.empty());
+ }
}
// child movieclip advance
@@ -1843,6 +1874,9 @@
// that's why it is not needed to analyze 'm_time_remainder'
if (m_on_event_load_called == false)
{
+#ifdef GNASH_DEBUG
+ log_msg("Calling ONLOAD event");
+#endif
on_event(event_id::LOAD); // clip onload
//
Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- utilities/processor.cpp 6 Dec 2006 10:21:32 -0000 1.41
+++ utilities/processor.cpp 7 Dec 2006 11:52:39 -0000 1.42
@@ -17,7 +17,7 @@
//
//
-/* $Id: processor.cpp,v 1.41 2006/12/06 10:21:32 strk Exp $ */
+/* $Id: processor.cpp,v 1.42 2006/12/07 11:52:39 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -47,6 +47,10 @@
#endif
}
+// How many seconds to wait for a frame advancement
+// before kicking the movie (forcing it to next frame)
+static const size_t waitforadvance = 5;
+
bool gofast = false; // FIXME: this flag gets set based on
// an XML message written using
// SendCommand(""). This way a movie
@@ -259,8 +263,13 @@
md->completeLoad();
- int kick_count = 0;
+ // How many times we allow a movie to be STOPPED
+ // in the same frame ?
+ float fps = md->get_frame_rate();
+ int maxstops=waitforadvance*(int)fps;
+ int kick_count = 0;
+ int stop_count=0;
// Run through the movie.
for (;;) {
// @@ do we also have to run through all sprite frames
@@ -277,12 +286,21 @@
m.advance(0.010f);
m.display();
- if (m.get_current_frame() == md->get_frame_count() - 1) {
- // Done.
+ size_t curr_frame = m.get_current_frame();
+
+ // We reached the end, done !
+ if (curr_frame >= md->get_frame_count() - 1) {
break;
}
- if (m.get_play_state() == gnash::sprite_instance::STOP) {
+ // We didn't advance
+ if (curr_frame == last_frame)
+ {
+ // Max stop counts reached, kick it
+ if ( ++stop_count >= maxstops)
+ {
+ stop_count=0;
+
// Kick the movie.
printf("kicking movie, kick ct = %d\n", kick_count);
m.goto_frame(last_frame + 1);
@@ -293,12 +311,19 @@
printf("movie is stalled; giving up on playing it through.\n");
break;
}
- } else if (m.get_current_frame() < last_frame) {
- // Hm, apparently we looped back. Skip ahead...
+ }
+ }
+
+ // We looped back. Skip ahead...
+ else if (m.get_current_frame() < last_frame)
+ {
printf("loop back; jumping to frame " SIZET_FMT "\n", last_frame);
m.goto_frame(last_frame + 1);
- } else {
+ }
+ else
+ {
kick_count = 0;
+ stop_count = 0;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/movie_root.cpp server/sp...,
Sandro Santilli <=