From 79662919c6358954a020b7d4ed52b6ecf93327f1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 12 Mar 2010 22:34:54 +0000 Subject: Fix bug #2969282: DW2: Weird "PC SPEAKER-like" sound distortion. svn-id: r48246 --- sound/decoders/adpcm.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sound/decoders') diff --git a/sound/decoders/adpcm.cpp b/sound/decoders/adpcm.cpp index 3ee92265a0..7a85bc24d5 100644 --- a/sound/decoders/adpcm.cpp +++ b/sound/decoders/adpcm.cpp @@ -405,6 +405,7 @@ public: : ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { if (blockAlign == 0) error("MS_ADPCMStream(): blockAlign isn't specified for MS ADPCM"); + memset(&_status, 0, sizeof(_status)); } virtual int readBuffer(int16 *buffer, const int numSamples); @@ -505,6 +506,7 @@ public: if (channels != 1) error("Tinsel_ADPCMStream(): Tinsel ADPCM only supports mono"); + memset(&_status, 0, sizeof(_status)); } }; @@ -595,11 +597,15 @@ protected: void reset() { ADPCMStream::reset(); _chunkPos = 0; + _chunkData = 0; } public: Tinsel6_ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign) - : Tinsel_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) {} + : Tinsel_ADPCMStream(stream, disposeAfterUse, size, rate, channels, blockAlign) { + _chunkPos = 0; + _chunkData = 0; + } virtual int readBuffer(int16 *buffer, const int numSamples); }; -- cgit v1.2.3