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: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1651-g9c9fde8
Date: Tue, 09 Jul 2013 21:21:35 +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  9c9fde8028519206d6f4f2e2f826863b916df8b2 (commit)
      from  3c5a05da07d3856965e8478cfae9a4f9b8044d43 (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=9c9fde8028519206d6f4f2e2f826863b916df8b2


commit 9c9fde8028519206d6f4f2e2f826863b916df8b2
Author: Bastiaan Jacques <address@hidden>
Date:   Tue Jul 9 23:20:10 2013 +0200

    Savannah #33760: Immediately start playback of streaming sounds; place no 
limits on buffering of event sounds.

diff --git a/libcore/asobj/Sound_as.cpp b/libcore/asobj/Sound_as.cpp
index 0ffe7d0..2f67907 100644
--- a/libcore/asobj/Sound_as.cpp
+++ b/libcore/asobj/Sound_as.cpp
@@ -385,7 +385,12 @@ Sound_as::probeAudio()
             // TODO: check if this should be called anyway.
             if (success) handleId3Data(_mediaParser->getId3Info(), owner());
         }
-        return; 
+
+        // If this is an event sound, we are done. Otherwise, if there is
+        // any data available, we should start playback.
+        if (!isStreaming || _mediaParser->isBufferEmpty()) {
+            return; 
+        }
     }
 
     if (isAttached()) {
@@ -603,7 +608,13 @@ Sound_as::loadSound(const std::string& file, bool 
streaming)
     }
 
     // TODO: use global _soundbuftime
-    _mediaParser->setBufferTime(60000); // one minute buffer... should be fine
+    if (isStreaming) {
+        _mediaParser->setBufferTime(60000); // one minute buffer... should be 
fine
+    } else {
+        // If this is an event sound, we must not limit buffering (parsing),
+        // because onLoad will not be called until we have finished doing so.
+        
_mediaParser->setBufferTime(std::numeric_limits<boost::uint64_t>::max());
+    }
 
     startProbeTimer();
 
diff --git a/libmedia/MediaParser.cpp b/libmedia/MediaParser.cpp
index 77eb5d6..e4de8ca 100644
--- a/libmedia/MediaParser.cpp
+++ b/libmedia/MediaParser.cpp
@@ -424,8 +424,8 @@ bool
 MediaParser::bufferFull() const
 {
        // Callers are expected to hold a lock on _qMutex
-       int bl = getBufferLengthNoLock();
-       int bt = getBufferTime();
+       boost::uint64_t bl = getBufferLengthNoLock();
+       boost::uint64_t bt = getBufferTime();
 #ifdef GNASH_DEBUG_MEDIAPARSER
        log_debug("MediaParser::bufferFull: %d/%d", bl, bt);
 #endif // GNASH_DEBUG_MEDIAPARSER
diff --git a/testsuite/actionscript.all/Sound.as 
b/testsuite/actionscript.all/Sound.as
index f50e645..c51fe17 100644
--- a/testsuite/actionscript.all/Sound.as
+++ b/testsuite/actionscript.all/Sound.as
@@ -28,7 +28,7 @@ rcsid="Sound.as";
 endOfTest = function()
 {
 #if OUTPUT_VERSION > 5
-    xcheck_totals(112);
+    check_totals(112);
 #else
     check_totals(94);
 #endif
@@ -161,13 +161,7 @@ mp3.loadSound(MEDIA(stereo8.mp3), false);
 // Try to load an mp3 sound (without any tags) that is longer than the
 // (at the time of writing) hard-coded single minute of buffer time.
 longsilence = new Sound();
-longsilence.onLoad = function()
-{
-    trace("onLoad called");
-    pass("onLoad called");
-};
-
-longsilence.loadSound(MEDIA(silence.mp3), false);
+longsilence.loadSound(MEDIA(silence.mp3), true);
 
 #endif
 
@@ -312,6 +306,10 @@ s.onSoundComplete = function()
     check_equals(typeof(s.onLoadArg), 'boolean');
     check_equals(s.onLoadArg, true);
 
+    // Test for #33760, continued: Having this test here is a hack, but the
+    // delay in calling this function will ensure the sound has started.
+    check(longsilence.position > 0);
+
     // TODO: test non-streaming sound 
     // TODO: test loadSound on unexistent sound 
 

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

Summary of changes:
 libcore/asobj/Sound_as.cpp          |   15 +++++++++++++--
 libmedia/MediaParser.cpp            |    4 ++--
 testsuite/actionscript.all/Sound.as |   14 ++++++--------
 3 files changed, 21 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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