[Scummvm-cvs-logs] SF.net SVN: scummvm:[48007] scummvm/trunk/sound/decoders/raw.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Feb 8 22:24:47 CET 2010


Revision: 48007
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48007&view=rev
Author:   lordhoto
Date:     2010-02-08 21:24:47 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
Fix RawStream::seek implementation.

Modified Paths:
--------------
    scummvm/trunk/sound/decoders/raw.cpp

Modified: scummvm/trunk/sound/decoders/raw.cpp
===================================================================
--- scummvm/trunk/sound/decoders/raw.cpp	2010-02-08 20:29:19 UTC (rev 48006)
+++ scummvm/trunk/sound/decoders/raw.cpp	2010-02-08 21:24:47 UTC (rev 48007)
@@ -185,6 +185,14 @@
 
 template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
 bool RawStream<stereo, is16Bit, isUnsigned, isLE>::seek(const Timestamp &where) {
+	_filePos = 0;
+	_diskLeft = 0;
+	_bufferLeft = 0;
+	_curBlock = _blocks.end();
+
+	if (where > _playtime)
+		return false;
+
 	const uint32 seekSample = convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames();
 	uint32 curSample = 0;
 
@@ -198,12 +206,8 @@
 		curSample = nextBlockSample;
 	}
 
-	_filePos = 0;
-	_diskLeft = 0;
-	_bufferLeft = 0;
-
 	if (_curBlock == _blocks.end()) {
-		return ((seekSample - curSample) == (uint32)_curBlock->len);
+		return ((seekSample - curSample) == 0);
 	} else {
 		const uint32 offset = seekSample - curSample;
 


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