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_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-351-gae88d85
Date: Thu, 19 May 2011 11:59:38 +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  ae88d8572b8bf2e57700aa43c10a2219ded95e69 (commit)
       via  ff7bceb21fe67266095ede137eae061798fe06ec (commit)
      from  60c583baedd2610c2a0cfeb9f6074c47696cb07e (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=ae88d8572b8bf2e57700aa43c10a2219ded95e69


commit ae88d8572b8bf2e57700aa43c10a2219ded95e69
Author: Sandro Santilli <address@hidden>
Date:   Thu May 19 13:58:46 2011 +0200

    Implement onSoundComplete for embedded event sounds, fixing bug #23020

diff --git a/libcore/asobj/Sound_as.cpp b/libcore/asobj/Sound_as.cpp
index 13dab69..a1864b2 100644
--- a/libcore/asobj/Sound_as.cpp
+++ b/libcore/asobj/Sound_as.cpp
@@ -346,6 +346,18 @@ Sound_as::update()
 void
 Sound_as::probeAudio()
 {
+    if ( ! externalSound ) {
+        // Only probe for sound complete
+        assert(_soundHandler);
+        assert(!_soundCompleted);
+        if ( ! _soundHandler->isSoundPlaying(soundId) ) {
+            _soundCompleted = false;
+            stopProbeTimer();
+            // dispatch onSoundComplete 
+            callMethod(&owner(), NSV::PROP_ON_SOUND_COMPLETE);
+        }
+        return;
+    }
 
     if (!_mediaParser) return; // nothing to do here w/out a media parser
 
@@ -706,7 +718,8 @@ Sound_as::start(double secOff, int loops)
                     true, // allow multiple instances (checked)
                     inPoint
                     );
-        startProbeTimer();
+
+        startProbeTimer(); // to dispatch onSoundComplete
     }
 }
 
diff --git a/libsound/sound_handler.cpp b/libsound/sound_handler.cpp
index 4528d2a..168957b 100644
--- a/libsound/sound_handler.cpp
+++ b/libsound/sound_handler.cpp
@@ -380,6 +380,22 @@ sound_handler::swfToOutSamples(const media::SoundInfo& 
sinfo,
     return outSamples;
 }
 
+/* public */
+bool
+sound_handler::isSoundPlaying(int sound_handle) const
+{
+    if ( sound_handle < 0 ||
+         static_cast<unsigned int>(sound_handle) >= _sounds.size() )
+    {
+        return false;
+    }
+
+    EmbedSound& sounddata = *(_sounds[sound_handle]);
+
+    // When this is called from a StreamSoundBlockTag,
+    // we only start if this sound isn't already playing.
+    return sounddata.isPlaying();
+}
 
 
 /* private */
diff --git a/libsound/sound_handler.h b/libsound/sound_handler.h
index c306068..575ed10 100644
--- a/libsound/sound_handler.h
+++ b/libsound/sound_handler.h
@@ -157,7 +157,7 @@ public:
     /// All scheduled sounds will be played on next output flush.
     ///
     /// @param id
-    ///     Id of the sound buffer slot schedule playback of.
+    ///     Id of the sound buffer slot to schedule playback of.
     ///
     /// @param loops
     ///     loops == 0 means play the sound once (1 means play it twice, etc)
@@ -189,6 +189,13 @@ public:
                    bool allowMultiple, unsigned int inPoint=0,
                    unsigned int outPoint=std::numeric_limits<unsigned 
int>::max());
 
+    /// Check if an event sound is playing
+    //
+    /// @param id
+    ///     Id of the sound buffer slot check for being alive
+    ///
+    bool isSoundPlaying(int id) const;
+
     /// Start playback of a streaming sound, if not playing already
     //
     ///

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


commit ff7bceb21fe67266095ede137eae061798fe06ec
Author: Sandro Santilli <address@hidden>
Date:   Thu May 19 12:56:38 2011 +0200

    Flushing of orphaned tags belong to action (not debug) logging

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 930bbee..1b9ddb8 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -877,14 +877,18 @@ MovieClip::advance()
         //       to orphaned playlist while we execute it.
         if (_currentFrame == 0 && _hasLooped) {
 
-                const size_t frame_count = get_loaded_frames(); 
-                if ( frame_count != 1 || ! _flushedOrphanedTags ) {
-                    log_debug("Flushing orphaned tags. _currentFrame:%d, 
_hasLooped:%d, frame_count:%d", _currentFrame, _hasLooped, frame_count);
-                    _flushedOrphanedTags = true;
-                    executeFrameTags(frame_count, _displayList,
-                            SWF::ControlTag::TAG_DLIST |
-                            SWF::ControlTag::TAG_ACTION);
-                }
+            const size_t frame_count = get_loaded_frames(); 
+            if ( frame_count != 1 || ! _flushedOrphanedTags ) {
+                IF_VERBOSE_ACTION(
+                log_action(_("Flushing orphaned tags in movieclip %1%. "
+                    "_currentFrame:%2%, _hasLooped:%3%, frame_count:%4%"),
+                    getTargetPath(), _currentFrame, _hasLooped, frame_count)
+                );
+                _flushedOrphanedTags = true;
+                executeFrameTags(frame_count, _displayList,
+                    SWF::ControlTag::TAG_DLIST |
+                    SWF::ControlTag::TAG_ACTION);
+            }
         }
 
         // Execute the current frame's tags.

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

Summary of changes:
 libcore/MovieClip.cpp      |   20 ++++++++++++--------
 libcore/asobj/Sound_as.cpp |   15 ++++++++++++++-
 libsound/sound_handler.cpp |   16 ++++++++++++++++
 libsound/sound_handler.h   |    9 ++++++++-
 4 files changed, 50 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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