mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-04 17:29:11 +00:00
Fix RawStream::seek implementation.
svn-id: r48007
This commit is contained in:
parent
17fef29507
commit
18f6ac4776
@ -185,6 +185,14 @@ int RawStream<stereo, is16Bit, isUnsigned, isLE>::readBuffer(int16 *buffer, cons
|
|||||||
|
|
||||||
template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
|
template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
|
||||||
bool RawStream<stereo, is16Bit, isUnsigned, isLE>::seek(const Timestamp &where) {
|
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();
|
const uint32 seekSample = convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames();
|
||||||
uint32 curSample = 0;
|
uint32 curSample = 0;
|
||||||
|
|
||||||
@ -198,12 +206,8 @@ bool RawStream<stereo, is16Bit, isUnsigned, isLE>::seek(const Timestamp &where)
|
|||||||
curSample = nextBlockSample;
|
curSample = nextBlockSample;
|
||||||
}
|
}
|
||||||
|
|
||||||
_filePos = 0;
|
|
||||||
_diskLeft = 0;
|
|
||||||
_bufferLeft = 0;
|
|
||||||
|
|
||||||
if (_curBlock == _blocks.end()) {
|
if (_curBlock == _blocks.end()) {
|
||||||
return ((seekSample - curSample) == (uint32)_curBlock->len);
|
return ((seekSample - curSample) == 0);
|
||||||
} else {
|
} else {
|
||||||
const uint32 offset = seekSample - curSample;
|
const uint32 offset = seekSample - curSample;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user