[Scummvm-cvs-logs] SF.net SVN: scummvm:[48357] scummvm/branches/branch-1-1-0/sound
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Mon Mar 22 16:57:46 CET 2010
Revision: 48357
http://scummvm.svn.sourceforge.net/scummvm/?rev=48357&view=rev
Author: lordhoto
Date: 2010-03-22 15:57:46 +0000 (Mon, 22 Mar 2010)
Log Message:
-----------
Backport of r48356: "Fix for bug #2969211 "NIPPON: Crash in Intro"."
Modified Paths:
--------------
scummvm/branches/branch-1-1-0/sound/audiostream.cpp
scummvm/branches/branch-1-1-0/sound/audiostream.h
scummvm/branches/branch-1-1-0/sound/decoders/iff_sound.cpp
Modified: scummvm/branches/branch-1-1-0/sound/audiostream.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/sound/audiostream.cpp 2010-03-22 15:54:56 UTC (rev 48356)
+++ scummvm/branches/branch-1-1-0/sound/audiostream.cpp 2010-03-22 15:57:46 UTC (rev 48357)
@@ -169,6 +169,8 @@
_loopStart(convertTimeToStreamPos(loopStart, getRate(), isStereo())),
_loopEnd(convertTimeToStreamPos(loopEnd, getRate(), isStereo())),
_done(false) {
+ assert(loopStart < loopEnd);
+
if (!_parent->rewind())
_done = true;
}
Modified: scummvm/branches/branch-1-1-0/sound/audiostream.h
===================================================================
--- scummvm/branches/branch-1-1-0/sound/audiostream.h 2010-03-22 15:54:56 UTC (rev 48356)
+++ scummvm/branches/branch-1-1-0/sound/audiostream.h 2010-03-22 15:57:46 UTC (rev 48357)
@@ -229,6 +229,16 @@
*/
class SubLoopingAudioStream : public AudioStream {
public:
+ /**
+ * Constructor for a SubLoopingAudioStream.
+ *
+ * @param stream Stream to loop
+ * @param loops How often the stream should be looped (0 means infinite)
+ * @param loopStart Start of the loop (this must be smaller than loopEnd)
+ * @param loopEnd End of the loop (thus must be greater than loopStart)
+ * @param disposeAfterUse Whether the stream should be disposed, when the
+ * SubLoopingAudioStream is destroyed.
+ */
SubLoopingAudioStream(SeekableAudioStream *stream, uint loops,
const Timestamp loopStart,
const Timestamp loopEnd,
Modified: scummvm/branches/branch-1-1-0/sound/decoders/iff_sound.cpp
===================================================================
--- scummvm/branches/branch-1-1-0/sound/decoders/iff_sound.cpp 2010-03-22 15:54:56 UTC (rev 48356)
+++ scummvm/branches/branch-1-1-0/sound/decoders/iff_sound.cpp 2010-03-22 15:57:46 UTC (rev 48357)
@@ -117,9 +117,11 @@
loopStart = loader._header.oneShotHiSamples;
loopEnd = loader._header.oneShotHiSamples + loader._header.repeatHiSamples;
- return new SubLoopingAudioStream(stream, 0,
+ if (loopStart != loopEnd) {
+ return new SubLoopingAudioStream(stream, 0,
Timestamp(0, loopStart, loader._header.samplesPerSec),
Timestamp(0, loopEnd, loader._header.samplesPerSec));
+ }
}
return stream;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list