diff options
author | Paul Gilbert | 2016-12-29 22:23:16 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-12-29 22:23:16 -0500 |
commit | cc4ede6509bb12a5d60861eb925640601fab6020 (patch) | |
tree | 972411b0edcbcf25ec9d3f5a4467e49af3bcb8c7 | |
parent | 2e8c80cf58e03ad735a5b147f11d31f07e49e33a (diff) | |
download | scummvm-rg350-cc4ede6509bb12a5d60861eb925640601fab6020.tar.gz scummvm-rg350-cc4ede6509bb12a5d60861eb925640601fab6020.tar.bz2 scummvm-rg350-cc4ede6509bb12a5d60861eb925640601fab6020.zip |
VIDEO: Further work on 2-track AVI videos
It turns out that at least one video in Starship Titanic, for the
Lift Indicator, has only a single transparency frame in track 2.
The added code, therefore, when it doesn't find an index entry
for the desired frame number, works backwards until it finds a valid
frame (likely frame 0), and then scans forward. If it hits the end
of the video, then it simply uses whatever last frame it last decoded.
-rw-r--r-- | video/avi_decoder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp index c2c485c1eb..32aa9f9044 100644 --- a/video/avi_decoder.cpp +++ b/video/avi_decoder.cpp @@ -726,7 +726,7 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) { OldIndex *entry = nullptr; do { entry = _indexEntries.find(_videoTracks.back().index, indexFrame); - } while (!entry && --indexFrame >= 0); + } while (!entry && indexFrame-- > 0); assert(entry); // Read in the frame @@ -740,7 +740,7 @@ bool AVIDecoder::seekIntern(const Audio::Timestamp &time) { if (indexFrame < frame) { TrackStatus &status = _videoTracks.back(); - while (indexFrame++ < frame) { + while (status.chunkSearchOffset < _movieListEnd && indexFrame++ < frame) { // There was no index entry for the desired frame, so an earlier one was decoded. // We now have to sequentially decode frames until we get to the desired frame handleNextPacket(status); |