[Scummvm-cvs-logs] CVS: scummvm/sound adpcm.cpp,1.7,1.8
Eugene Sandulenko
sev at users.sourceforge.net
Thu Sep 22 13:47:05 CEST 2005
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27391
Modified Files:
adpcm.cpp
Log Message:
Fix regression caused by recent code cleanup. Each input byte should be
processed twice, so even if stream end is reached, there should be another
iteration. Otherwise it always returned one byte less than expected.
Index: adpcm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/adpcm.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- adpcm.cpp 17 Sep 2005 10:58:01 -0000 1.7
+++ adpcm.cpp 22 Sep 2005 20:45:46 -0000 1.8
@@ -72,7 +72,9 @@
int ADPCMInputStream<TYPE>::readBuffer(int16 *buffer, const int numSamples) {
int samples;
- for (samples = 0; samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples++) {
+ // Since we process high and low nibbles separately never check buffer end
+ // on low nibble
+ for (samples = 0; !_evenPos || samples < numSamples && !_stream->eos() && _stream->pos() < _endpos; samples++) {
if (_evenPos) {
_lastByte = _stream->readByte();
buffer[samples] = decode((_lastByte >> 4) & 0x0f);
More information about the Scummvm-git-logs
mailing list