From 87c81566b429693d96ef7da7196d5503c33cde91 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Feb 2011 22:07:34 +0100 Subject: AUDIO: Fix assertion triggered by SubSeekableAudioStream constructor. This assertion was introduced with 633b8ed27784. I change the code to first convert all parameters to the audio stream's framerate to avoid a possible use of operator- on two AudioTimestamps with different framerates. --- audio/audiostream.cpp | 4 ++-- 1 file 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); -- cgit v1.2.3