diff options
author | D G Turner | 2012-12-10 16:29:16 +0000 |
---|---|---|
committer | D G Turner | 2012-12-10 16:29:16 +0000 |
commit | 62d87e30f4dcdd78dc43747a5cdb1cc450bf4d3b (patch) | |
tree | 8207560d7628b3f0902e1b67b8cf032ddba7ac98 /audio/decoders/adpcm_intern.h | |
parent | b532a81b42bce16838347aa560138da1b15418e5 (diff) | |
download | scummvm-rg350-62d87e30f4dcdd78dc43747a5cdb1cc450bf4d3b.tar.gz scummvm-rg350-62d87e30f4dcdd78dc43747a5cdb1cc450bf4d3b.tar.bz2 scummvm-rg350-62d87e30f4dcdd78dc43747a5cdb1cc450bf4d3b.zip |
AUDIO: Fix MS ADPCM to work with Mono streams using odd sized buffers.
Diffstat (limited to 'audio/decoders/adpcm_intern.h')
-rw-r--r-- | audio/decoders/adpcm_intern.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/audio/decoders/adpcm_intern.h b/audio/decoders/adpcm_intern.h index 3b8d8c74d0..66a1aa605f 100644 --- a/audio/decoders/adpcm_intern.h +++ b/audio/decoders/adpcm_intern.h @@ -206,12 +206,19 @@ public: if (blockAlign == 0) error("MS_ADPCMStream(): blockAlign isn't specified for MS ADPCM"); memset(&_status, 0, sizeof(_status)); + _decodedSampleCount = 0; } + virtual bool endOfData() const { return (_stream->eos() || _stream->pos() >= _endpos) && (_decodedSampleCount == 0); } + virtual int readBuffer(int16 *buffer, const int numSamples); protected: int16 decodeMS(ADPCMChannelStatus *c, byte); + +private: + uint8 _decodedSampleCount; + int16 _decodedSamples[4]; }; // Duck DK3 IMA ADPCM Decoder |