diff options
author | Matthew Hoops | 2014-08-14 20:16:14 -0400 |
---|---|---|
committer | Matthew Hoops | 2014-08-14 20:16:14 -0400 |
commit | d2bf7f99fd20fbc0b6126e5c8ae6833d3491d030 (patch) | |
tree | 7f9d0f6f6dbbe3317e98b96f23a1a365be91f648 /audio | |
parent | e525878444e3b324a5bae42e3cc92f2921cd086f (diff) | |
download | scummvm-rg350-d2bf7f99fd20fbc0b6126e5c8ae6833d3491d030.tar.gz scummvm-rg350-d2bf7f99fd20fbc0b6126e5c8ae6833d3491d030.tar.bz2 scummvm-rg350-d2bf7f99fd20fbc0b6126e5c8ae6833d3491d030.zip |
AUDIO: Really fix seeking with audio edits
I really have no idea what I was thinking in acb127c2
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decoders/quicktime.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp index 547abd2aa4..331c850b1a 100644 --- a/audio/decoders/quicktime.cpp +++ b/audio/decoders/quicktime.cpp @@ -414,8 +414,15 @@ void QuickTimeAudioDecoder::QuickTimeAudioTrack::skipSamples(const Timestamp &le } void QuickTimeAudioDecoder::QuickTimeAudioTrack::findEdit(const Timestamp &position) { - for (_curEdit = 0; _curEdit < _parentTrack->editCount - 1 && position > Timestamp(0, _parentTrack->editList[_curEdit].timeOffset, _decoder->_timeScale); _curEdit++) - ; + // Go through the edits look for where we find out we need to be. As long + // as the position is >= to the edit's start time, it is considered to be in that + // edit. seek() already figured out if we reached the last edit, so we don't need + // to handle that case here. + for (_curEdit = 0; _curEdit < _parentTrack->editCount - 1; _curEdit++) { + Timestamp nextEditTime(0, _parentTrack->editList[_curEdit + 1].timeOffset, _decoder->_timeScale); + if (position < nextEditTime) + break; + } enterNewEdit(position); } |