diff options
Diffstat (limited to 'audio/decoders/adpcm.cpp')
-rw-r--r-- | audio/decoders/adpcm.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp index f75196c882..535652a0b3 100644 --- a/audio/decoders/adpcm.cpp +++ b/audio/decoders/adpcm.cpp @@ -41,8 +41,7 @@ namespace Audio { // <http://wiki.multimedia.cx/index.php?title=Microsoft_IMA_ADPCM>. ADPCMStream::ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, uint32 size, int rate, int channels, uint32 blockAlign) - : _stream(stream), - _disposeAfterUse(disposeAfterUse), + : _stream(stream, disposeAfterUse), _startpos(stream->pos()), _endpos(_startpos + size), _channels(channels), @@ -52,11 +51,6 @@ ADPCMStream::ADPCMStream(Common::SeekableReadStream *stream, DisposeAfterUse::Fl reset(); } -ADPCMStream::~ADPCMStream() { - if (_disposeAfterUse == DisposeAfterUse::YES) - delete _stream; -} - void ADPCMStream::reset() { memset(&_status, 0, sizeof(_status)); _blockPos[0] = _blockPos[1] = _blockAlign; // To make sure first header is read @@ -234,7 +228,7 @@ int MSIma_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) { while (samples < numSamples && _samplesLeft[0] != 0) { for (int i = 0; i < _channels; i++) { - buffer[samples] = _buffer[i][8 - _samplesLeft[i]]; + buffer[samples + i] = _buffer[i][8 - _samplesLeft[i]]; _samplesLeft[i]--; } |