gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r10219: Make sure the _stage is regi


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10219: Make sure the _stage is registered before calling stop(). This has the
Date: Mon, 03 Nov 2008 09:02:31 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10219
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-11-03 09:02:31 +0100
message:
  Make sure the _stage is registered before calling stop(). This has the
  advantage of ensuring gtk is also ready, so that stopHook() should always
  work the first time, and also won't mess up the stage size. Add assertions
  to make debugging easier if something goes wrong.
  
  New swfdec tests pass.
modified:
  gui/Player.cpp
  gui/gtk.cpp
  gui/gui.cpp
  testsuite/swfdec/PASSING
=== modified file 'gui/Player.cpp'
--- a/gui/Player.cpp    2008-10-29 08:50:14 +0000
+++ b/gui/Player.cpp    2008-11-03 08:02:31 +0000
@@ -210,13 +210,6 @@
     if ( _doRender )
     {
         _gui = getGui(); 
-
-        RcInitFile& rcfile = RcInitFile::getDefaultInstance();
-        if ( rcfile.startStopped() )
-        {
-            _gui->stop();
-        }
-
     }
     else
     {
@@ -423,6 +416,18 @@
 
     _gui->setStage(&root);
 
+    // When startStopped is true, stop here after the stage has been 
+    // registered, but before the movie has started. Initial loading
+    // and VM initialization have been done by this stage, but not
+    // the complete parsing of the SWF. This is important because
+    // the Gui accesses movie_root to get the sound_handler, but
+    // also because the 
+    RcInitFile& rcfile = RcInitFile::getDefaultInstance();
+    if ( rcfile.startStopped() )
+    {
+        _gui->stop();
+    }
+
     // Start loader thread
     // NOTE: the loader thread might (in IMPORT tag parsing)
     //       create new movies and register them to the MovieLibrary.

=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp       2008-10-28 15:32:20 +0000
+++ b/gui/gtk.cpp       2008-11-03 08:02:31 +0000
@@ -226,7 +226,7 @@
 
     // The first time stop() was called, stopHook() might not have had a chance
     // to do anything, because GTK+ wasn't garanteed to be initialised.
-    if (isStopped()) stopHook();
+    //if (isStopped()) stopHook();
 
     return true;
 }

=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp       2008-10-28 15:32:20 +0000
+++ b/gui/gui.cpp       2008-11-03 08:02:31 +0000
@@ -444,19 +444,15 @@
 void
 Gui::toggleSound()
 {
-
+    assert (_stage);
     // @todo since we registered the sound handler, shouldn't we know
     //       already what it is ?!
     sound::sound_handler* s = _stage->runInfo().soundHandler();
 
-    if (!s)
-       return;
+    if (!s) return;
 
-    if (s->is_muted()) {
-       s->unmute();
-    } else {
-       s->mute();
-    }
+    if (s->is_muted()) s->unmute();
+    else s->mute();
 }
 
 
@@ -838,6 +834,7 @@
     if ( ! _started ) start();
     else
     {
+        assert (_stage);
         // @todo since we registered the sound handler, shouldn't we know
         //       already what it is ?!
         sound::sound_handler* s = _stage->runInfo().soundHandler();
@@ -850,6 +847,9 @@
 void
 Gui::stop()
 {
+    // _stage must be registered before this is called.
+    assert(_stage);
+
     if ( _stopped ) return;
     if ( isFullscreen() ) unsetFullscreen();
 

=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING  2008-10-31 12:58:04 +0000
+++ b/testsuite/swfdec/PASSING  2008-11-03 08:02:31 +0000
@@ -612,6 +612,10 @@
 newobject-paths-7.swf:e8af4c2cd51e1b3c5e7ab3121386d0ba
 newobject-paths-8.swf:fc8407413a00bf2e41e27db7e7ec8c9f
 nextframe-stop.swf:8528e3ead382f99f046e6c27aa4fd311
+number-construct-5.swf:088dba71e4cd7a40af90e5e9d587d37d
+number-construct-6.swf:dcc593e3aa5895ba1afb3aacbaf0b6a0
+number-construct-7.swf:983a9fd7016e14aa58b03cd0b4f4cf08
+number-construct-8.swf:cded06557be37197e945a29fd09e0b0f
 number.swf:3ef5211bf02f128749453b0ea006061d
 number-tostring-radix-5.swf:9c620b9523efbfc2cd30832d38c3d403
 number-tostring-radix-6.swf:82b91ba51d982a8c27dddffd129051df


reply via email to

[Prev in Thread] Current Thread [Next in Thread]