|
From: Yoda-JM <yo...@us...> - 2009-07-13 10:42:02
|
Module: performous
Branch: master
Commit: a96b96c732eb6b6542237ae566fc5843b1cd4cc0
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Jul 13 12:41:32 2009 +0200
Fixed multi-track seeking
---
game/audio.cc | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index f289928..7db4e06 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -148,10 +148,11 @@ void Audio::seek(double offset) {
void Audio::seekPos(double pos) {
boost::recursive_mutex::scoped_lock l(m_mutex);
if (m_streams.empty()) return;
- Stream& s = m_streams.back();
- int position = clamp(pos, 0.0, s.mpeg.duration() - 1.0);
- s.mpeg.seek(position);
- s.prebuffering = true;
+ for (Streams::iterator it = m_streams.begin(); it != m_streams.end(); ++it) {
+ int position = clamp(pos, 0.0, it->mpeg.duration() - 1.0);
+ it->mpeg.seek(position);
+ it->prebuffering = true;
+ }
m_paused = false;
}
|