[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9748: Check whether sound has been
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9748: Check whether sound has been deleted before mixing; might fix bug #22314. |
Date: |
Mon, 15 Sep 2008 16:17:20 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9748
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-09-15 16:17:20 +0200
message:
Check whether sound has been deleted before mixing; might fix bug #22314.
modified:
libmedia/ffmpeg/sound_handler_sdl.cpp
libmedia/ffmpeg/sound_handler_sdl.h
=== modified file 'libmedia/ffmpeg/sound_handler_sdl.cpp'
--- a/libmedia/ffmpeg/sound_handler_sdl.cpp 2008-09-14 10:13:01 +0000
+++ b/libmedia/ffmpeg/sound_handler_sdl.cpp 2008-09-15 14:17:20 +0000
@@ -825,11 +825,15 @@
}
}
+ const SDL_sound_handler::Sounds& soundData = handler->m_sound_data;
+
// Run through all the sounds. TODO: don't call .size() at every
iteration !
- for(boost::uint32_t i=0; i < handler->m_sound_data.size(); i++)
+ for (SDL_sound_handler::Sounds::const_iterator i = soundData.begin(),
+ e = soundData.end(); i != e; ++i)
{
- sound_data* sounddata = handler->m_sound_data[i];
- handler->mixSoundData(*sounddata, buffer, buffer_length);
+ // Check whether sound has been deleted first.
+ if (!*i) continue;
+ handler->mixSoundData(**i, buffer, buffer_length);
}
//
=== modified file 'libmedia/ffmpeg/sound_handler_sdl.h'
--- a/libmedia/ffmpeg/sound_handler_sdl.h 2008-06-25 21:22:28 +0000
+++ b/libmedia/ffmpeg/sound_handler_sdl.h 2008-09-15 14:17:20 +0000
@@ -303,6 +303,10 @@
// Use SDL and ffmpeg/mad/nothing to handle sounds.
class SDL_sound_handler : public sound_handler
{
+public:
+
+ typedef std::vector<sound_data*> Sounds;
+
private:
/// AS classes (NetStream, Sound) audio callbacks
typedef std::map< void* /* owner */, aux_streamer_ptr /* callback */>
CallbacksMap;
@@ -312,7 +316,7 @@
//
/// Elemenst of the vector are owned by this class
///
- typedef std::vector<sound_data*> Sounds;
+
Sounds m_sound_data;
/// Is sound device opened?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9748: Check whether sound has been deleted before mixing; might fix bug #22314.,
Benjamin Wolsey <=