gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-176-g6f8f606
Date: Sat, 05 Mar 2011 08:30:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  6f8f606ee6a0658067b67b6bda7fc8dfff54565a (commit)
       via  f74f541652c370888cac6889ea49e4821c686e1a (commit)
      from  4191a46adfe29bc47c699e08f50a3c51ce47c83f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=6f8f606ee6a0658067b67b6bda7fc8dfff54565a


commit 6f8f606ee6a0658067b67b6bda7fc8dfff54565a
Merge: 4191a46 f74f541
Author: Benjamin Wolsey <address@hidden>
Date:   Sat Mar 5 09:05:14 2011 +0100

    Merge gprocessor fix.

diff --cc utilities/processor.cpp
index 293169b,765e6f0..cf8c9cf
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@@ -442,116 -440,123 +440,125 @@@ play_movie(const std::string& filename
  
      // Use a clock advanced at every iteration to match exact FPS speed.
      ManualClock cl;
-     gnash::movie_root m(*md, cl, runResources);
-     
-     // Register processor to receive ActionScript events (Mouse, Stage
-     // System etc).
-     m.registerEventCallback(&eventCallback);
-     m.registerFSCommandCallback(&execFsCommand);
- 
-     md->completeLoad();
- 
-     MovieClip::MovieVariables v;
-     m.init(md.get(), v);
  
-     log_debug("iteration, timer: %lu, localDelay: %ld\n",
-             cl.elapsed(), localDelay);
-     gnashSleep(localDelay);
-     
-     resetLastAdvanceTimer();
-     int       kick_count = 0;
-     int stop_count=0;
-     size_t loop_back_count=0;
-     size_t latest_frame=0;
-     size_t end_hitcount=0;
-     size_t nadvances=0;
-     // Run through the movie.
-     while (!quitrequested) {
 -    // Scope to ensure that movie_root is destroyed before the
 -    // movie_definition can be. Otherwise we can get illegal
 -    // accesses from MovieLoader threads.
++    // Scope to ensure that movie_root is destroyed before the library
++    // is cleared; otherwise movie_root's MovieLoader can continue to
++    // add movie_definitions to MovieLibrary, which then keeps them
++    // and their parsing thread alive until static destruction. The parser
++    // can then continue to access destroyed resources.
+     {
+         gnash::movie_root m(*md, cl, runResources);
          
-         size_t        last_frame = m.get_current_frame();
-         //printf("advancing clock by %lu\n", clockAdvance);
-         cl.advance(clockAdvance);
-         m.advance();
- 
-         if ( quitrequested ) 
-         {
-             quitrequested = false;
-             break;
-         }
+         // Register processor to receive ActionScript events (Mouse, Stage
+         // System etc).
+         m.registerEventCallback(&eventCallback);
+         m.registerFSCommandCallback(&execFsCommand);
  
-         m.display(); // FIXME: for which reason are we calling display here ??
-         ++nadvances;
-         if ( limit_advances && nadvances >= limit_advances)
-         {
-             log_debug("exiting after %d advances", nadvances);
-             break;
-         }
+         md->completeLoad();
  
-         size_t curr_frame = m.get_current_frame();
+         MovieClip::MovieVariables v;
+         m.init(md.get(), v);
+ 
+         log_debug("iteration, timer: %lu, localDelay: %ld\n",
+                 cl.elapsed(), localDelay);
+         gnashSleep(localDelay);
          
-         // We reached the end, done !
-         if (curr_frame >= md->get_frame_count() - 1 )
-         {
-             if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
+         resetLastAdvanceTimer();
+         int   kick_count = 0;
+         int stop_count=0;
+         size_t loop_back_count=0;
+         size_t latest_frame=0;
+         size_t end_hitcount=0;
+         size_t nadvances=0;
+         // Run through the movie.
+         while (!quitrequested) {
+             
+             size_t    last_frame = m.get_current_frame();
+             //printf("advancing clock by %lu\n", clockAdvance);
+             cl.advance(clockAdvance);
+             m.advance();
+ 
+             if ( quitrequested ) 
              {
-                 log_debug("exiting after %d" 
-                        " times last frame was reached", end_hitcount);
-                     break;
+                 quitrequested = false;
+                 break;
+             }
+ 
+             m.display(); // FIXME: for which reason are we calling display 
here ??
+             ++nadvances;
+             if ( limit_advances && nadvances >= limit_advances)
+             {
+                 log_debug("exiting after %d advances", nadvances);
+                 break;
              }
-         }
  
-         // We didn't advance 
-         if (curr_frame == last_frame)
-         {
-             // Max stop counts reached, kick it
-             if ( secondsSinceLastAdvance() > waitforadvance )
+             size_t curr_frame = m.get_current_frame();
+             
+             // We reached the end, done !
+             if (curr_frame >= md->get_frame_count() - 1 )
              {
-                 stop_count=0;
+                 if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
+                 {
+                     log_debug("exiting after %d" 
+                            " times last frame was reached", end_hitcount);
+                         break;
+                 }
+             }
  
-                 // Kick the movie.
-                 if ( last_frame + 1 > md->get_frame_count() -1 )
+             // We didn't advance 
+             if (curr_frame == last_frame)
+             {
+                 // Max stop counts reached, kick it
+                 if ( secondsSinceLastAdvance() > waitforadvance )
                  {
-                     fprintf(stderr, "Exiting after %g seconds in STOP mode at 
last frame\n", waitforadvance);
-                     break;
+                     stop_count=0;
+ 
+                     // Kick the movie.
+                     if ( last_frame + 1 > md->get_frame_count() -1 )
+                     {
+                         fprintf(stderr, "Exiting after %g seconds in STOP 
mode at last frame\n", waitforadvance);
+                         break;
+                     }
+                     fprintf(stderr, "Kicking movie after %g seconds in STOP 
mode, kick ct = %d\n", waitforadvance, kick_count);
+                     fflush(stderr);
+                     m.goto_frame(last_frame + 1);
+                     
m.getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
+                     kick_count++;
+ 
+                     if (kick_count > 10) {
+                         printf("movie is stalled; giving up on playing it 
through.\n");
+                         break;
+                     }
+ 
+                         resetLastAdvanceTimer(); // It's like we advanced
                  }
-                 fprintf(stderr, "Kicking movie after %g seconds in STOP mode, 
kick ct = %d\n", waitforadvance, kick_count);
-                 fflush(stderr);
-                 m.goto_frame(last_frame + 1);
-                 
m.getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
-                 kick_count++;
- 
-                 if (kick_count > 10) {
-                     printf("movie is stalled; giving up on playing it 
through.\n");
-                     break;
+             }
+             
+             // We looped back.  Skip ahead...
+             else if (m.get_current_frame() < last_frame)
+             {
+                 if ( last_frame > latest_frame ) latest_frame = last_frame;
+                 if ( ++loop_back_count > allowloopbacks )
+                 {
+                     log_debug("%d loop backs; jumping one-after "
+                             "latest frame (%d)",
+                             loop_back_count, latest_frame+1);
+                     m.goto_frame(latest_frame + 1);
+                     loop_back_count = 0;
                  }
- 
-                     resetLastAdvanceTimer(); // It's like we advanced
              }
-         }
-         
-         // We looped back.  Skip ahead...
-         else if (m.get_current_frame() < last_frame)
-         {
-             if ( last_frame > latest_frame ) latest_frame = last_frame;
-             if ( ++loop_back_count > allowloopbacks )
+             else
              {
-                 log_debug("%d loop backs; jumping one-after "
-                         "latest frame (%d)",
-                         loop_back_count, latest_frame+1);
-                 m.goto_frame(latest_frame + 1);
-                 loop_back_count = 0;
+                 kick_count = 0;
+                 stop_count = 0;
+                 resetLastAdvanceTimer();
              }
-         }
-         else
-         {
-             kick_count = 0;
-             stop_count = 0;
-             resetLastAdvanceTimer();
+ 
+             log_debug("iteration, timer: %lu, localDelay: %ld\n",
+                     cl.elapsed(), localDelay);
+             gnashSleep(localDelay);
          }
  
-         log_debug("iteration, timer: %lu, localDelay: %ld\n",
-                 cl.elapsed(), localDelay);
-         gnashSleep(localDelay);
      }
  
      log_debug("-- Playback completed");

http://git.savannah.gnu.org/cgit//commit/?id=f74f541652c370888cac6889ea49e4821c686e1a


commit f74f541652c370888cac6889ea49e4821c686e1a
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Mar 2 12:38:31 2011 +0100

    Ensure movie_root is destroyed before movie_definition.
    Fixes bug #31868.

diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index 293169b..765e6f0 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -232,12 +232,12 @@ main(int argc, char *argv[])
     for (c = 0; c < argc; c++) {
       if (strcmp("--help", argv[c]) == 0) {
         usage(argv[0]);
-        exit(EXIT_SUCCESS);
+        return EXIT_SUCCESS;
       }
       if (strcmp("--version", argv[c]) == 0) {
         printf (_("Gnash gprocessor version: %s, Gnash version: %s\n"),
                   GPROC_VERSION, VERSION);
-        exit(EXIT_SUCCESS);
+        return EXIT_SUCCESS;
       }
     }
  
@@ -271,7 +271,7 @@ main(int argc, char *argv[])
          case 'h':
              usage (argv[0]);
               dbglogfile.removeLog();
-             exit(EXIT_SUCCESS);
+             return EXIT_SUCCESS;
          case 'v':
              dbglogfile.setVerbosity();
              log_debug (_("Verbose output turned on"));
@@ -306,11 +306,11 @@ main(int argc, char *argv[])
              break;
          case ':':
               fprintf(stderr, "Missing argument for switch ``%c''\n", optopt); 
-             exit(EXIT_FAILURE);
+             return EXIT_FAILURE;
          case '?':
          default:
               fprintf(stderr, "Unknown switch ``%c''\n", optopt); 
-             exit(EXIT_FAILURE);
+             return EXIT_FAILURE;
        }
     }
     
@@ -326,7 +326,7 @@ main(int argc, char *argv[])
            std::cerr << "no input files" << std::endl;
            usage(argv[0]);
         dbglogfile.removeLog();
-           exit(EXIT_FAILURE);
+           return EXIT_FAILURE;
     }
 
     boost::shared_ptr<gnash::media::MediaHandler> mediaHandler;
@@ -336,8 +336,6 @@ main(int argc, char *argv[])
     mediaHandler.reset(media::MediaFactory::instance().get(mh));
     soundHandler.reset(new sound::NullSoundHandler(mediaHandler.get()));
 
-
-
     boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
     addDefaultLoaders(*loaders);
 
@@ -373,7 +371,7 @@ main(int argc, char *argv[])
                if (s_stop_on_errors) {
                    // Fail.
                 std::cerr << "error playing through movie " << *i << std::endl;
-                       std::exit(EXIT_FAILURE);
+                       return EXIT_FAILURE;
                }
         }
        
@@ -442,116 +440,123 @@ play_movie(const std::string& filename, const 
RunResources& runResources)
 
     // Use a clock advanced at every iteration to match exact FPS speed.
     ManualClock cl;
-    gnash::movie_root m(*md, cl, runResources);
-    
-    // Register processor to receive ActionScript events (Mouse, Stage
-    // System etc).
-    m.registerEventCallback(&eventCallback);
-    m.registerFSCommandCallback(&execFsCommand);
-
-    md->completeLoad();
-
-    MovieClip::MovieVariables v;
-    m.init(md.get(), v);
 
-    log_debug("iteration, timer: %lu, localDelay: %ld\n",
-            cl.elapsed(), localDelay);
-    gnashSleep(localDelay);
-    
-    resetLastAdvanceTimer();
-    int        kick_count = 0;
-    int stop_count=0;
-    size_t loop_back_count=0;
-    size_t latest_frame=0;
-    size_t end_hitcount=0;
-    size_t nadvances=0;
-    // Run through the movie.
-    while (!quitrequested) {
+    // Scope to ensure that movie_root is destroyed before the
+    // movie_definition can be. Otherwise we can get illegal
+    // accesses from MovieLoader threads.
+    {
+        gnash::movie_root m(*md, cl, runResources);
         
-        size_t last_frame = m.get_current_frame();
-        //printf("advancing clock by %lu\n", clockAdvance);
-        cl.advance(clockAdvance);
-        m.advance();
-
-        if ( quitrequested ) 
-        {
-            quitrequested = false;
-            break;
-        }
+        // Register processor to receive ActionScript events (Mouse, Stage
+        // System etc).
+        m.registerEventCallback(&eventCallback);
+        m.registerFSCommandCallback(&execFsCommand);
 
-        m.display(); // FIXME: for which reason are we calling display here ??
-        ++nadvances;
-        if ( limit_advances && nadvances >= limit_advances)
-        {
-            log_debug("exiting after %d advances", nadvances);
-            break;
-        }
+        md->completeLoad();
 
-        size_t curr_frame = m.get_current_frame();
+        MovieClip::MovieVariables v;
+        m.init(md.get(), v);
+
+        log_debug("iteration, timer: %lu, localDelay: %ld\n",
+                cl.elapsed(), localDelay);
+        gnashSleep(localDelay);
         
-        // We reached the end, done !
-        if (curr_frame >= md->get_frame_count() - 1 )
-        {
-            if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
+        resetLastAdvanceTimer();
+        int    kick_count = 0;
+        int stop_count=0;
+        size_t loop_back_count=0;
+        size_t latest_frame=0;
+        size_t end_hitcount=0;
+        size_t nadvances=0;
+        // Run through the movie.
+        while (!quitrequested) {
+            
+            size_t     last_frame = m.get_current_frame();
+            //printf("advancing clock by %lu\n", clockAdvance);
+            cl.advance(clockAdvance);
+            m.advance();
+
+            if ( quitrequested ) 
             {
-                log_debug("exiting after %d" 
-                       " times last frame was reached", end_hitcount);
-                    break;
+                quitrequested = false;
+                break;
+            }
+
+            m.display(); // FIXME: for which reason are we calling display 
here ??
+            ++nadvances;
+            if ( limit_advances && nadvances >= limit_advances)
+            {
+                log_debug("exiting after %d advances", nadvances);
+                break;
             }
-        }
 
-        // We didn't advance 
-        if (curr_frame == last_frame)
-        {
-            // Max stop counts reached, kick it
-            if ( secondsSinceLastAdvance() > waitforadvance )
+            size_t curr_frame = m.get_current_frame();
+            
+            // We reached the end, done !
+            if (curr_frame >= md->get_frame_count() - 1 )
             {
-                stop_count=0;
+                if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
+                {
+                    log_debug("exiting after %d" 
+                           " times last frame was reached", end_hitcount);
+                        break;
+                }
+            }
 
-                // Kick the movie.
-                if ( last_frame + 1 > md->get_frame_count() -1 )
+            // We didn't advance 
+            if (curr_frame == last_frame)
+            {
+                // Max stop counts reached, kick it
+                if ( secondsSinceLastAdvance() > waitforadvance )
                 {
-                    fprintf(stderr, "Exiting after %g seconds in STOP mode at 
last frame\n", waitforadvance);
-                    break;
+                    stop_count=0;
+
+                    // Kick the movie.
+                    if ( last_frame + 1 > md->get_frame_count() -1 )
+                    {
+                        fprintf(stderr, "Exiting after %g seconds in STOP mode 
at last frame\n", waitforadvance);
+                        break;
+                    }
+                    fprintf(stderr, "Kicking movie after %g seconds in STOP 
mode, kick ct = %d\n", waitforadvance, kick_count);
+                    fflush(stderr);
+                    m.goto_frame(last_frame + 1);
+                    
m.getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
+                    kick_count++;
+
+                    if (kick_count > 10) {
+                        printf("movie is stalled; giving up on playing it 
through.\n");
+                        break;
+                    }
+
+                        resetLastAdvanceTimer(); // It's like we advanced
                 }
-                fprintf(stderr, "Kicking movie after %g seconds in STOP mode, 
kick ct = %d\n", waitforadvance, kick_count);
-                fflush(stderr);
-                m.goto_frame(last_frame + 1);
-                
m.getRootMovie().setPlayState(gnash::MovieClip::PLAYSTATE_PLAY);
-                kick_count++;
-
-                if (kick_count > 10) {
-                    printf("movie is stalled; giving up on playing it 
through.\n");
-                    break;
+            }
+            
+            // We looped back.  Skip ahead...
+            else if (m.get_current_frame() < last_frame)
+            {
+                if ( last_frame > latest_frame ) latest_frame = last_frame;
+                if ( ++loop_back_count > allowloopbacks )
+                {
+                    log_debug("%d loop backs; jumping one-after "
+                            "latest frame (%d)",
+                            loop_back_count, latest_frame+1);
+                    m.goto_frame(latest_frame + 1);
+                    loop_back_count = 0;
                 }
-
-                    resetLastAdvanceTimer(); // It's like we advanced
             }
-        }
-        
-        // We looped back.  Skip ahead...
-        else if (m.get_current_frame() < last_frame)
-        {
-            if ( last_frame > latest_frame ) latest_frame = last_frame;
-            if ( ++loop_back_count > allowloopbacks )
+            else
             {
-                log_debug("%d loop backs; jumping one-after "
-                        "latest frame (%d)",
-                        loop_back_count, latest_frame+1);
-                m.goto_frame(latest_frame + 1);
-                loop_back_count = 0;
+                kick_count = 0;
+                stop_count = 0;
+                resetLastAdvanceTimer();
             }
-        }
-        else
-        {
-            kick_count = 0;
-            stop_count = 0;
-            resetLastAdvanceTimer();
+
+            log_debug("iteration, timer: %lu, localDelay: %ld\n",
+                    cl.elapsed(), localDelay);
+            gnashSleep(localDelay);
         }
 
-        log_debug("iteration, timer: %lu, localDelay: %ld\n",
-                cl.elapsed(), localDelay);
-        gnashSleep(localDelay);
     }
 
     log_debug("-- Playback completed");

-----------------------------------------------------------------------

Summary of changes:
 utilities/processor.cpp |  209 ++++++++++++++++++++++++-----------------------
 1 files changed, 108 insertions(+), 101 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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