[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. cd96c57e9e2b53d1e762
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. cd96c57e9e2b53d1e762c9424f1ca1eec888f4f6 |
Date: |
Wed, 20 Oct 2010 15:50:32 +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 cd96c57e9e2b53d1e762c9424f1ca1eec888f4f6 (commit)
via 02e9e19bc5662e62414b01168b14243b2aed9f32 (commit)
from 1405791f1c7f4c32832d700dbc364e88ebeac4e1 (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=cd96c57e9e2b53d1e762c9424f1ca1eec888f4f6
commit cd96c57e9e2b53d1e762c9424f1ca1eec888f4f6
Author: Sandro Santilli <address@hidden>
Date: Wed Oct 20 17:49:47 2010 +0200
Add dirty sample fetch frequency debugging support (needs macro)
diff --git a/libsound/sound_handler.cpp b/libsound/sound_handler.cpp
index c771101..4f9bac0 100644
--- a/libsound/sound_handler.cpp
+++ b/libsound/sound_handler.cpp
@@ -22,15 +22,17 @@
#include "InputStream.h" // for use
#include "EmbedSoundInst.h" // for upcasting to InputStream
#include "log.h" // for use
+#include "WallClockTimer.h" // for debugging
#include <boost/cstdint.hpp> // For C99 int types
#include <vector> // for use
+#include <cmath> // for floor (debugging)
// Debug create_sound/delete_sound/playSound/stop_sound, loops
//#define GNASH_DEBUG_SOUNDS_MANAGEMENT
// Debug samples fetching
-//#define GNASH_DEBUG_SAMPLES_FETCHING
+//#define GNASH_DEBUG_SAMPLES_FETCHING 1
namespace gnash {
namespace sound {
@@ -543,6 +545,21 @@ sound_handler::unplugAllInputStreams()
void
sound_handler::fetchSamples (boost::int16_t* to, unsigned int nSamples)
{
+#ifdef GNASH_DEBUG_SAMPLES_FETCHING
+ // should we use SystemClock for checking this ?
+ static WallClockTimer timerTotal;
+ static WallClockTimer timerLocal;
+ static size_t fetched = 0;
+ fetched += nSamples;
+ boost::uint32_t tl = timerLocal.elapsed();
+ if ( tl > 1000 ) {
+ boost::uint32_t tt = timerTotal.elapsed();
+ log_debug("Samples fetch frequency: %d KHz (expected 44.100)",
+ floor(fetched*500.0/tt)/1000);
+ timerLocal.restart();
+ }
+#endif
+
if ( isPaused() ) return;
float finalVolumeFact = getFinalVolume()/100.0;
@@ -555,8 +572,8 @@ sound_handler::fetchSamples (boost::int16_t* to, unsigned
int nSamples)
// A buffer to fetch InputStream samples into
boost::scoped_array<boost::int16_t> buf ( new boost::int16_t[nSamples]
);
-#ifdef GNASH_DEBUG_SAMPLES_FETCHING
- log_debug("Fetching %d samples for %d input streams", nSamples,
_inputStreams.size());
+#if GNASH_DEBUG_SAMPLES_FETCHING > 1
+ log_debug("Fetching %d samples from each of %d input streams",
nSamples, _inputStreams.size());
#endif
// Loop through the aux streamers sounds
@@ -573,7 +590,7 @@ sound_handler::fetchSamples (boost::int16_t* to, unsigned
int nSamples)
std::fill(buf.get()+wrote, buf.get()+nSamples, 0);
}
-#ifdef GNASH_DEBUG_SAMPLES_FETCHING
+#if GNASH_DEBUG_SAMPLES_FETCHING > 1
log_debug(" fetched %d/%d samples from input stream %p"
" (%d samples fetchehd in total)",
wrote, nSamples, is, is->samplesFetched());
http://git.savannah.gnu.org/cgit//commit/?id=02e9e19bc5662e62414b01168b14243b2aed9f32
commit 02e9e19bc5662e62414b01168b14243b2aed9f32
Author: Sandro Santilli <address@hidden>
Date: Wed Oct 20 17:14:29 2010 +0200
Do not include headers needed for gettimeofday as we're not using it
directly anymore now
diff --git a/gui/dump.cpp b/gui/dump.cpp
index 5b0e1a8..6a534f9 100644
--- a/gui/dump.cpp
+++ b/gui/dump.cpp
@@ -54,11 +54,6 @@
#error Dump gui requires sys/time.h header (POSIX)
#endif
-// For gettimeofday TODO: Use something better for main loop;
-// something that works on Windows?
-#include <sys/time.h>
-#include <unistd.h>
-
// Only include signal handlers on OS' that support it
#ifdef HAVE_SIGNAL_H
#include <signal.h>
-----------------------------------------------------------------------
Summary of changes:
gui/dump.cpp | 5 -----
libsound/sound_handler.cpp | 25 +++++++++++++++++++++----
2 files changed, 21 insertions(+), 9 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. cd96c57e9e2b53d1e762c9424f1ca1eec888f4f6,
Sandro Santilli <=