aboutsummaryrefslogtreecommitdiff
path: root/audio/decoders/quicktime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/decoders/quicktime.cpp')
-rw-r--r--audio/decoders/quicktime.cpp11
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);
}