[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11018: Moved attach_aux_streamer to
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11018: Moved attach_aux_streamer to base class, as instructed by TODO comment |
Date: |
Sun, 07 Jun 2009 01:29:42 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 11018
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Sun 2009-06-07 01:29:42 +0200
message:
Moved attach_aux_streamer to base class, as instructed by TODO comment
modified:
libsound/sdl/sound_handler_sdl.cpp
libsound/sdl/sound_handler_sdl.h
libsound/sound_handler.cpp
libsound/sound_handler.h
=== modified file 'libsound/sdl/sound_handler_sdl.cpp'
--- a/libsound/sdl/sound_handler_sdl.cpp 2009-06-05 23:55:37 +0000
+++ b/libsound/sdl/sound_handler_sdl.cpp 2009-06-06 23:29:42 +0000
@@ -201,16 +201,6 @@
void
-SDL_sound_handler::playSound(int id, int loops, int offSecs,
- long startPos, const SoundEnvelopes* env, bool allowMulti)
-{
- boost::mutex::scoped_lock lock(_mutex);
- // WARNING: playSound might trigger another lock of _mutex here (check me)
- sound_handler::playSound(id, loops, offSecs, startPos, env, allowMulti);
-}
-
-
-void
SDL_sound_handler::stop_sound(int soundHandle)
{
boost::mutex::scoped_lock lock(_mutex);
@@ -255,24 +245,6 @@
return sound_handler::get_sound_info(soundHandle);
}
-InputStream*
-SDL_sound_handler::attach_aux_streamer(aux_streamer_ptr ptr, void* owner)
-{
- // TODO: move to base class !!
-
- boost::mutex::scoped_lock lock(_mutex);
- assert(owner);
- assert(ptr);
-
- std::auto_ptr<InputStream> newStreamer ( new AuxStream(ptr, owner) );
-
- InputStream* ret = newStreamer.get();
-
- plugInputStream(newStreamer);
-
- return ret;
-}
-
unsigned int
SDL_sound_handler::get_duration(int soundHandle)
{
@@ -407,10 +379,12 @@
void
SDL_sound_handler::plugInputStream(std::auto_ptr<InputStream> newStreamer)
{
- // TODO: lock the mutex once attach_aux_streamer is in the base class
+ boost::mutex::scoped_lock lock(_mutex);
sound_handler::plugInputStream(newStreamer);
+ lock.unlock(); // we need to unlock before unpausing (right?)
+
#ifdef GNASH_DEBUG_SDL_AUDIO_PAUSING
log_debug("Unpausing SDL Audio...");
#endif
=== modified file 'libsound/sdl/sound_handler_sdl.h'
--- a/libsound/sdl/sound_handler_sdl.h 2009-06-05 23:55:37 +0000
+++ b/libsound/sdl/sound_handler_sdl.h 2009-06-06 23:29:42 +0000
@@ -112,11 +112,6 @@
unsigned int sample_count, int handle_id);
// See dox in sound_handler.h
- virtual void playSound(int id, int loops, int secsOffset,
- long start, const SoundEnvelopes* env,
- bool allowMultiple);
-
- // See dox in sound_handler.h
virtual void stop_sound(int sound_handle);
// See dox in sound_handler.h
@@ -164,9 +159,6 @@
virtual unsigned int tell(int sound_handle);
// See dox in sound_handler.h
- virtual InputStream* attach_aux_streamer(aux_streamer_ptr ptr, void*
owner);
-
- // See dox in sound_handler.h
// Overridden to unpause SDL audio
void plugInputStream(std::auto_ptr<InputStream> in);
=== modified file 'libsound/sound_handler.cpp'
--- a/libsound/sound_handler.cpp 2009-02-25 22:33:03 +0000
+++ b/libsound/sound_handler.cpp 2009-06-06 23:29:42 +0000
@@ -609,5 +609,20 @@
sound_handler::stop_all_sounds();
}
+InputStream*
+sound_handler::attach_aux_streamer(aux_streamer_ptr ptr, void* owner)
+{
+ assert(owner);
+ assert(ptr);
+
+ std::auto_ptr<InputStream> newStreamer ( new AuxStream(ptr, owner) );
+
+ InputStream* ret = newStreamer.get();
+
+ plugInputStream(newStreamer);
+
+ return ret;
+}
+
} // gnash.sound namespace
} // namespace gnash
=== modified file 'libsound/sound_handler.h'
--- a/libsound/sound_handler.h 2009-02-25 22:33:03 +0000
+++ b/libsound/sound_handler.h 2009-06-06 23:29:42 +0000
@@ -305,8 +305,7 @@
///
/// @see unplugInputStream
///
- virtual InputStream* attach_aux_streamer(aux_streamer_ptr ptr, void*
udata)
- { ptr=ptr; /*unused*/ udata=udata; /*unused*/ return 0; }
+ virtual InputStream* attach_aux_streamer(aux_streamer_ptr ptr, void*
udata);
/// Unplug an external InputStream from the mixer
//
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11018: Moved attach_aux_streamer to base class, as instructed by TODO comment,
Sandro Santilli <=