diff options
author | Johannes Schickel | 2010-01-01 22:57:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-01 22:57:08 +0000 |
commit | 137744c40c5e5ab717c364a113cf5e83ca104663 (patch) | |
tree | 7e3d89e60f2f3195cf38214b13411f20c2eeb84d /sound/vorbis.cpp | |
parent | 2e9d5a5f41636054f57b4a90b3f9165902963c3c (diff) | |
download | scummvm-rg350-137744c40c5e5ab717c364a113cf5e83ca104663.tar.gz scummvm-rg350-137744c40c5e5ab717c364a113cf5e83ca104663.tar.bz2 scummvm-rg350-137744c40c5e5ab717c364a113cf5e83ca104663.zip |
This time properly fix getTotalPlayTime for looped FLAC, MP3 and VORBIS audio streams.
svn-id: r46863
Diffstat (limited to 'sound/vorbis.cpp')
-rw-r--r-- | sound/vorbis.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 8e0cda06c9..bb73a26d06 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -221,13 +221,9 @@ int VorbisInputStream::readBuffer(int16 *buffer, const int numSamples) { // If we are still out of data, and also past the end of specified // time range, check whether looping is enabled... if (_pos >= _bufferEnd && ov_time_tell(&_ovFile) >= _endTime) { - if (_numLoops != 1) { - // If looping is on and there are loops left, rewind to the start - if (_numLoops != 0) - _numLoops--; - - _numPlayedLoops++; - + ++_numPlayedLoops; + // If looping is on and there are loops left, rewind to the start + if (!_numLoops || _numPlayedLoops < _numLoops) { res = ov_time_seek(&_ovFile, _startTime); if (res < 0) { warning("Error seeking in Vorbis stream (%d)", res); |