diff options
author | Matthew Hoops | 2015-01-26 19:51:18 -0500 |
---|---|---|
committer | Matthew Hoops | 2015-01-26 19:54:32 -0500 |
commit | d58f250918f742fd7fd035d7764433f492520e45 (patch) | |
tree | 59efe90d9f94845c13eb938d7a273e6890dc75d3 /audio | |
parent | 5b9231ade6e87a9419bb480903bf41c3bf673d41 (diff) | |
download | scummvm-rg350-d58f250918f742fd7fd035d7764433f492520e45.tar.gz scummvm-rg350-d58f250918f742fd7fd035d7764433f492520e45.tar.bz2 scummvm-rg350-d58f250918f742fd7fd035d7764433f492520e45.zip |
AUDIO: Fix skipping samples when the skip length is greater than the first chunk
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decoders/quicktime.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index 331c850b1a..ff87e7a9f8 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -241,6 +241,15 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::queueAudio(const Timestamp &len // If we have any samples that we need to skip (ie. we seeked into // the middle of a chunk), skip them here. if (_skipSamples != Timestamp()) { + if (_skipSamples > chunkLength) { + // If the amount we need to skip is greater than the size + // of the chunk, just skip it altogether. + _curMediaPos = _curMediaPos + chunkLength; + _skipSamples = _skipSamples - chunkLength; + delete stream; + continue; + } + skipSamples(_skipSamples, stream); _curMediaPos = _curMediaPos + _skipSamples; chunkLength = chunkLength - _skipSamples; |