Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
AUDIO: Fix skipping samples when the skip length is greater than the …
…first chunk
  • Loading branch information
clone2727 committed Jan 27, 2015
1 parent 5b9231a commit d58f250
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions audio/decoders/quicktime.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit d58f250

Please sign in to comment.