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. 506f951aa1c79483ccab


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 506f951aa1c79483ccaba7c84b0c69be7feba526
Date: Wed, 15 Sep 2010 11:33:30 +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  506f951aa1c79483ccaba7c84b0c69be7feba526 (commit)
       via  5249c17525f2df5ef89409564893885f1029c913 (commit)
      from  4d47840708d25f5760396233704b5f533b3c3e0c (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=506f951aa1c79483ccaba7c84b0c69be7feba526


commit 506f951aa1c79483ccaba7c84b0c69be7feba526
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Sep 15 13:29:36 2010 +0200

    Drop debugging.

diff --git a/gui/sdl/sdl.cpp b/gui/sdl/sdl.cpp
index 22b3460..85e2df8 100644
--- a/gui/sdl/sdl.cpp
+++ b/gui/sdl/sdl.cpp
@@ -44,13 +44,11 @@ SDLGui::SDLGui(unsigned long xid, float scale, bool loop, 
RunResources& r)
 
 SDLGui::~SDLGui()
 {
-    GNASH_REPORT_FUNCTION;
 }
 
 bool
 SDLGui::run()
 {
-    GNASH_REPORT_FUNCTION;
     int x_old = -1;
     int y_old = -1;
     int button_state_old = -1;
@@ -177,7 +175,6 @@ bool
 SDLGui::createWindow(const char *title, int width, int height,
                      int /*xPosition*/, int /*yPosition*/)
 {
-    GNASH_REPORT_FUNCTION;
     _width = width;
     _height = height;
 
@@ -216,8 +213,6 @@ SDLGui::setInvalidatedRegions(const InvalidatedRanges& 
ranges)
 void
 SDLGui::renderBuffer()
 {
-    //GNASH_REPORT_FUNCTION;
-
     _glue.render();
 }
 
@@ -230,14 +225,12 @@ SDLGui::setInterval(unsigned int interval)
 bool
 SDLGui::createMenu()
 {
-    GNASH_REPORT_FUNCTION;
     return false;
 }
 
 bool
 SDLGui::setupEvents()
 {
-    GNASH_REPORT_FUNCTION;
     return false;
 }
 

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


commit 5249c17525f2df5ef89409564893885f1029c913
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Sep 15 13:28:16 2010 +0200

    Add tiny sleep to prevent hang on windows.

diff --git a/libsound/sdl/sound_handler_sdl.cpp 
b/libsound/sdl/sound_handler_sdl.cpp
index 81aefb3..5195898 100644
--- a/libsound/sdl/sound_handler_sdl.cpp
+++ b/libsound/sdl/sound_handler_sdl.cpp
@@ -25,6 +25,7 @@
 #include "SoundInfo.h"
 #include "EmbedSound.h"
 #include "AuxStream.h" // for use..
+#include "GnashSleep.h"
 
 #include "log.h" // will import boost::format too
 #include "GnashException.h" // for SoundException
@@ -78,8 +79,15 @@ SDL_sound_handler::initAudio()
     //       of throwing an exception on error (unavailable audio
     //       card). Normally we'd want to open the audio card only
     //       when needed (it has a cost in number of wakeups).
-    //
     openAudio();
+
+#ifdef WIN32
+    // SDL can hang on windows if SDL_CloseAudio() is called immediately
+    // after SDL_OpenAudio(). It's evidently to do with threading, but
+    // internal to SDL. This is a tacky solution, but it's only windows.
+    gnashSleep(1);
+#endif
+
     closeAudio();
 
 }
@@ -87,7 +95,7 @@ SDL_sound_handler::initAudio()
 void
 SDL_sound_handler::openAudio()
 {
-    if ( _audioOpened ) return; // nothing to do
+    if (_audioOpened) return; // nothing to do
 
     // This is our sound settings
     audioSpec.freq = 44100;
@@ -106,9 +114,8 @@ SDL_sound_handler::openAudio()
     //512 - not enough for  videostream
     audioSpec.samples = 2048;   
 
-    if (SDL_OpenAudio(&audioSpec, NULL) < 0 ) {
-            boost::format fmt = boost::format(
-                _("Unable to open SDL audio: %s"))
+    if (SDL_OpenAudio(&audioSpec, NULL) < 0) {
+            boost::format fmt = boost::format(_("Couldn't open SDL audio: %s"))
                 % SDL_GetError();
         throw SoundException(fmt.str());
     }
@@ -133,14 +140,15 @@ SDL_sound_handler::SDL_sound_handler(media::MediaHandler* 
m,
 
     initAudio();
 
-    if (! wavefile.empty() ) {
+    if (!wavefile.empty()) {
         file_stream.open(wavefile.c_str());
         if (file_stream.fail()) {
             std::cerr << "Unable to write file '" << wavefile << std::endl;
-            exit(EXIT_FAILURE);
-        } else {
-                write_wave_header(file_stream);
-                std::cout << "# Created 44100 16Mhz stereo wave file:" << 
std::endl <<
+            std::exit(EXIT_FAILURE);
+        } 
+        else {
+            write_wave_header(file_stream);
+            std::cout << "# Created 44100 16Mhz stereo wave file:\n" <<
                     "AUDIOFILE=" << wavefile << std::endl;
         }
     }
@@ -342,16 +350,15 @@ SDL_sound_handler::fetchSamples(boost::int16_t* to, 
unsigned int nSamples)
 
 // Callback invoked by the SDL audio thread.
 void
-SDL_sound_handler::sdl_audio_callback (void *udata, Uint8 *buf, int bufLenIn)
+SDL_sound_handler::sdl_audio_callback(void *udata, Uint8 *buf, int bufLenIn)
 {
-    if ( bufLenIn < 0 )
-    {
-        log_error(_("Negative buffer length in sdl_audio_callback (%d)"), 
bufLenIn);
+    if (bufLenIn < 0) {
+        log_error(_("Negative buffer length in sdl_audio_callback (%d)"),
+                bufLenIn);
         return;
     }
 
-    if ( bufLenIn == 0 )
-    {
+    if (bufLenIn == 0) {
         log_error(_("Zero buffer length in sdl_audio_callback"));
         return;
     }
@@ -425,15 +432,13 @@ void
 SDL_sound_handler::pause() 
 {
     closeAudio();
-
     sound_handler::pause();
 }
 
 void
 SDL_sound_handler::unpause() 
 {
-    if ( hasInputStreams() )
-    {
+    if (hasInputStreams()) {
         openAudio();
         SDL_PauseAudio(0);
     }

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

Summary of changes:
 gui/sdl/sdl.cpp                    |    7 ------
 libsound/sdl/sound_handler_sdl.cpp |   43 ++++++++++++++++++++----------------
 2 files changed, 24 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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