diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2008-12-16 15:08:57 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2008-12-16 15:08:57 +0800 |
commit | 6334b8814811e807602bcba92b4fc0ab388707bf (patch) | |
tree | 61dfd71c29db3e74acdcd93e9243f4a95416edd9 /src | |
parent | cc43aad14c5cf914745f4d78938663aa607ca53a (diff) |
MixerDevice: remove the condition variable.
It doesn't improve latency.
Diffstat (limited to 'src')
-rw-r--r-- | src/device_mixer.cpp | 16 | ||||
-rw-r--r-- | src/device_mixer.h | 1 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/device_mixer.cpp b/src/device_mixer.cpp index c9b3851..3f2d61e 100644 --- a/src/device_mixer.cpp +++ b/src/device_mixer.cpp @@ -52,19 +52,8 @@ namespace audiere { // if not, return zeroed samples if (!any_playing) { - m_available.wait(*this, 0.01); - - for (std::list<MixerStream*>::iterator i = m_streams.begin(); - i != m_streams.end(); - ++i) - { - any_playing |= (*i)->m_is_playing; - } - - if (!any_playing) { - memset(samples, 0, 4 * sample_count); - return sample_count; - } + memset(samples, 0, 4 * sample_count); + return sample_count; } ADR_LOG("at least one stream is playing"); @@ -141,7 +130,6 @@ namespace audiere { MixerStream::play() { SYNCHRONIZED(m_device.get()); m_is_playing = true; - m_device->m_available.notify(); } diff --git a/src/device_mixer.h b/src/device_mixer.h index cb90f4b..87817da 100644 --- a/src/device_mixer.h +++ b/src/device_mixer.h @@ -44,7 +44,6 @@ namespace audiere { private: std::list<MixerStream*> m_streams; int m_rate; - CondVar m_available; friend class MixerStream; }; |