diff -ur --exclude=CVS ScummVM/scummvm/sound/vorbis.cpp ScummVM+hack/scummvm/sound/vorbis.cpp
old
|
new
|
|
173 | 173 | const int16 *_bufferEnd; |
174 | 174 | const int16 *_pos; |
175 | 175 | int _played; |
| 176 | uint32 _readBufferTime; |
176 | 177 | |
177 | 178 | void refill(); |
178 | 179 | inline bool eosIntern() const; |
… |
… |
|
185 | 186 | bool isStereo() const { return _numChannels >= 2; } |
186 | 187 | |
187 | 188 | int getRate() const { return ov_info(_ov_file, -1)->rate; } |
188 | | int getSamplesPlayed() const { return _played / _numChannels; } |
| 189 | int getSamplesPlayed() const { |
| 190 | return (_played / _numChannels) + (((g_system->get_msecs() - _readBufferTime) * getRate()) / 1000); |
| 191 | } |
189 | 192 | |
190 | 193 | }; |
191 | 194 | |
… |
… |
|
209 | 212 | |
210 | 213 | // Read in initial data |
211 | 214 | refill(); |
| 215 | |
| 216 | _readBufferTime = g_system->get_msecs(); |
212 | 217 | } |
213 | 218 | |
214 | 219 | inline int16 VorbisInputStream::read() { |
… |
… |
|
239 | 244 | } |
240 | 245 | } |
241 | 246 | _played += samples; |
| 247 | _readBufferTime = g_system->get_msecs(); |
242 | 248 | return samples; |
243 | 249 | } |
244 | 250 | |