diff options
-rw-r--r-- | audio/decoders/aac.cpp | 3 | ||||
-rw-r--r-- | audio/decoders/quicktime.h | 8 | ||||
-rw-r--r-- | common/quicktime.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/audio/decoders/aac.cpp b/audio/decoders/aac.cpp index fb867250b7..b38d4e03b4 100644 --- a/audio/decoders/aac.cpp +++ b/audio/decoders/aac.cpp @@ -128,6 +128,7 @@ int AACStream::readBuffer(int16 *buffer, const int numSamples) { assert((numSamples % _channels) == 0); + // Dip into our remaining samples pool if it's available if (_remainingSamples) { samples = MIN<int>(numSamples, _remainingSamplesSize - _remainingSamplesPos); @@ -140,6 +141,7 @@ int AACStream::readBuffer(int16 *buffer, const int numSamples) { } } + // Decode until we have enough samples (or there's no more left) while (samples < numSamples && !endOfData()) { NeAACDecFrameInfo frameInfo; uint16 *decodedSamples = (uint16 *)NeAACDecDecode(_handle, &frameInfo, _inBuffer + _inBufferPos, _inBufferSize - _inBufferPos); @@ -153,6 +155,7 @@ int AACStream::readBuffer(int16 *buffer, const int numSamples) { memcpy(buffer + samples, decodedSamples, copySamples * 2); samples += copySamples; + // Copy leftover samples for use in a later readBuffer() call if (copySamples != decodedSampleSize) { _remainingSamplesSize = decodedSampleSize - copySamples; _remainingSamples = new int16[_remainingSamplesSize]; diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h index 6e9f5b2c4e..2fca5d6944 100644 --- a/audio/decoders/quicktime.h +++ b/audio/decoders/quicktime.h @@ -23,6 +23,14 @@ * */ +/** + * @file + * Sound decoder used in engines: + * - groovie + * - mohawk + * - sci + */ + #ifndef AUDIO_QUICKTIME_H #define AUDIO_QUICKTIME_H diff --git a/common/quicktime.h b/common/quicktime.h index 8e6b0ec64c..c54d7f158e 100644 --- a/common/quicktime.h +++ b/common/quicktime.h @@ -43,9 +43,10 @@ namespace Common { class MacResManager; /** - * Parser for QuickTime files. + * Parser for QuickTime/MPEG-4 files. * * File parser used in engines: + * - groovie * - mohawk * - sci */ |