[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/movie_instance.cpp serve...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/movie_instance.cpp serve... |
Date: |
Tue, 25 Sep 2007 14:57:05 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/09/25 14:57:05
Modified files:
. : ChangeLog
server : movie_instance.cpp sprite_instance.cpp
sprite_instance.h
server/parser : sprite_definition.cpp sprite_definition.h
Log message:
* server/parser/sprite_definition.h (ensure_frame_loaded): don't
assume the target frame has always been loaded, as we might
have loaded less frames then advertised in header.
* server/parser/sprite_definition.cpp (read): don't change
total frame count if zero. We wan't to respect it for
_totalframes
to return the correct value.
* server/sprite_instance.{cpp,h}: don't assume m_current_frame
is less
then frame count or even loaded frames, as we might have
loaded NO
frames too; use a std::set rather then a vector of boolean to
tell
wheter init actions for a given frame have been executed;
check
frames loaded count when needed.
* server/movie_instance.cpp (advance, stagePlacementCallback):
drop
the frames loaded count check, it's now in sprite_instance.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4405&r2=1.4406
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.cpp?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.358&r2=1.359
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.142&r2=1.143
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sprite_definition.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sprite_definition.h?cvsroot=gnash&r1=1.30&r2=1.31
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4405
retrieving revision 1.4406
diff -u -b -r1.4405 -r1.4406
--- ChangeLog 25 Sep 2007 14:20:46 -0000 1.4405
+++ ChangeLog 25 Sep 2007 14:57:04 -0000 1.4406
@@ -1,5 +1,21 @@
2007-09-25 Sandro Santilli <address@hidden>
+ * server/parser/sprite_definition.h (ensure_frame_loaded): don't
+ assume the target frame has always been loaded, as we might
+ have loaded less frames then advertised in header.
+ * server/parser/sprite_definition.cpp (read): don't change
+ total frame count if zero. We wan't to respect it for _totalframes
+ to return the correct value.
+ * server/sprite_instance.{cpp,h}: don't assume m_current_frame is less
+ then frame count or even loaded frames, as we might have loaded NO
+ frames too; use a std::set rather then a vector of boolean to tell
+ wheter init actions for a given frame have been executed; check
+ frames loaded count when needed.
+ * server/movie_instance.cpp (advance, stagePlacementCallback): drop
+ the frames loaded count check, it's now in sprite_instance.
+
+2007-09-25 Sandro Santilli <address@hidden>
+
* doc/C/usermanual/usage/gnashrc.xml: document StreamsTimeout
directive, remove duplicated line for StartStopped.
* libbase/: Makefile.am, WallClockTimer.{h,cpp}:
Index: server/movie_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_instance.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- server/movie_instance.cpp 21 Sep 2007 08:29:02 -0000 1.18
+++ server/movie_instance.cpp 25 Sep 2007 14:57:05 -0000 1.19
@@ -63,22 +63,6 @@
);
}
- // The parser might have reset the total frame count
- // due to SWF malformation, so we check this *after*
- // the ensure_frame_loaded call above.
- //
- if ( get_frame_count() == 0 )
- {
- IF_VERBOSE_MALFORMED_SWF(
- static bool warned=false;
- if ( ! warned ) {
- log_swferror(_("The movie with url %s has NO frames!"),
m_def->get_url().c_str());
- warned=true;
- }
- );
- return;
- }
-
// Invoke parent placement event handler
sprite_instance::stagePlacementCallback();
}
@@ -107,22 +91,6 @@
);
}
- // The parser might have reset the total frame count
- // due to SWF malformation, so we check this *after*
- // the ensure_frame_loaded call above.
- //
- if ( get_frame_count() == 0 )
- {
- IF_VERBOSE_MALFORMED_SWF(
- static bool warned=false;
- if ( ! warned ) {
- log_swferror(_("The movie with url %s has NO frames!"),
m_def->get_url().c_str());
- warned=true;
- }
- );
- return;
- }
-
advance_sprite(delta_time);
//_def->resumeLoader();
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.358
retrieving revision 1.359
diff -u -b -r1.358 -r1.359
--- server/sprite_instance.cpp 24 Sep 2007 10:07:06 -0000 1.358
+++ server/sprite_instance.cpp 25 Sep 2007 14:57:05 -0000 1.359
@@ -1693,7 +1693,7 @@
m_as_environment.set_target(this);
// Initialize the flags for init action executed.
- m_init_actions_executed.assign(m_def->get_frame_count(), false);
+ //m_init_actions_executed.assign(m_def->get_frame_count(), false);
// TODO: have the 'MovieClip' constructor take care of this !
attachMovieClipProperties(*this);
@@ -2232,6 +2232,20 @@
assert(!isUnloaded());
assert(!_callingFrameActions); // call_frame shoudl never trigger
advance_sprite
+ // We might have loaded NO frames !
+ if ( get_loaded_frames() == 0 )
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ static bool warned=false;
+ if ( ! warned ) {
+ log_swferror(_("advance_sprite: no frames loaded for
sprite/movie %s"), getTarget().c_str());
+ warned=true;
+ }
+ );
+ return;
+ }
+
+
// Process any pending loadVariables request
processCompletedLoadVariableRequests();
@@ -2385,12 +2399,12 @@
{
testInvariant();
- assert(frame < m_def->get_frame_count());
+ assert(frame < get_loaded_frames());
assert(typeflags);
// Execute this frame's init actions, if necessary.
- if (m_init_actions_executed[frame] == false)
+ if ( m_init_actions_executed.insert(frame).second )
{
const PlayList* init_actions = m_def->get_init_actions(frame);
@@ -2415,7 +2429,7 @@
// Mark this frame done, so we never execute these
// init actions again.
- m_init_actions_executed[frame] = true;
+ //m_init_actions_executed[frame] = true;
//do_actions();
}
@@ -2838,7 +2852,8 @@
{
//GNASH_REPORT_FUNCTION;
- size_t frame_count = m_def->get_frame_count();
+ //size_t frame_count = m_def->get_frame_count();
+ size_t frame_count = get_loaded_frames();
if ( ++m_current_frame >= frame_count )
{
// Loop.
@@ -3233,6 +3248,19 @@
{
assert(!isUnloaded());
+ // We might have loaded NO frames !
+ if ( get_loaded_frames() == 0 )
+ {
+ IF_VERBOSE_MALFORMED_SWF(
+ static bool warned=false;
+ if ( ! warned ) {
+ log_swferror(_("stagePlacementCallback: no frames
loaded for sprite/movie %s"), getTarget().c_str());
+ warned=true;
+ }
+ );
+ return;
+ }
+
#ifdef GNASH_DEBUG
log_debug(_("Constructing sprite '%s'"), _origTarget.c_str());
#endif
Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -b -r1.142 -r1.143
--- server/sprite_instance.h 24 Sep 2007 10:07:07 -0000 1.142
+++ server/sprite_instance.h 25 Sep 2007 14:57:05 -0000 1.143
@@ -636,7 +636,11 @@
void testInvariant() const {
assert(m_play_state == PLAY || m_play_state == STOP);
- assert(m_current_frame < m_def->get_frame_count());
+
+ // m_current_frame may be 0, since this is our initial
+ // condition. Still, frame count might be 0 as well, and
+ // loaded frames too !
+ //assert(m_current_frame < m_def->get_frame_count());
#ifndef GNASH_USE_GC
assert(get_ref_count() > 0); // or we're constructed but
// not stored in a
boost::intrusive_ptr
@@ -909,7 +913,7 @@
bool _callingFrameActions;
// a bit-array class would be ideal for this
- std::vector<bool> m_init_actions_executed;
+ std::set<size_t> m_init_actions_executed;
/// This timeline's variable scope
as_environment m_as_environment;
Index: server/parser/sprite_definition.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/sprite_definition.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/parser/sprite_definition.cpp 17 Sep 2007 12:21:47 -0000 1.20
+++ server/parser/sprite_definition.cpp 25 Sep 2007 14:57:05 -0000 1.21
@@ -68,13 +68,6 @@
m_frame_count = in->read_u16();
- // ALEX: some SWF files have been seen that have 0-frame sprites.
- // The Macromedia player behaves as if they have 1 frame.
- if (m_frame_count < 1)
- {
- m_frame_count = 1;
- }
-
IF_VERBOSE_PARSE (
log_parse(_(" frames = " SIZET_FMT), m_frame_count);
);
Index: server/parser/sprite_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/sprite_definition.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/parser/sprite_definition.h 17 Sep 2007 23:33:18 -0000 1.30
+++ server/parser/sprite_definition.h 25 Sep 2007 14:57:05 -0000 1.31
@@ -352,8 +352,8 @@
"loading of frame " SIZET_FMT " requested "
"(we are at " SIZET_FMT "/" SIZET_FMT ")"),
framenum, m_loading_frame, m_frame_count);
- // Could this ever happen ?
- assert(0);
+ // Could this ever happen ? YES ! See
tuner_7_6_0_0_pandora.swf
+ return false;
}
return true;
}