diff options
-rw-r--r-- | audio/audiostream.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp index 46b2846137..0c41a38254 100644 --- a/audio/audiostream.cpp +++ b/audio/audiostream.cpp @@ -228,8 +228,8 @@ int SubLoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) { SubSeekableAudioStream::SubSeekableAudioStream(SeekableAudioStream *parent, const Timestamp start, const Timestamp end, DisposeAfterUse::Flag disposeAfterUse) : _parent(parent), _disposeAfterUse(disposeAfterUse), _start(convertTimeToStreamPos(start, getRate(), isStereo())), - _pos(0, getRate() * (isStereo() ? 2 : 1)), - _length(convertTimeToStreamPos(end - start, getRate(), isStereo())) { + _pos(0, getRate() * (isStereo() ? 2 : 1)), + _length(convertTimeToStreamPos(end, getRate(), isStereo()) - _start) { assert(_length.totalNumberOfFrames() % (isStereo() ? 2 : 1) == 0); _parent->seek(_start); |