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.
This commit is contained in:
Paul Gilbert 2016-12-29 22:23:16 -05:00
parent 2e8c80cf58
commit cc4ede6509

View file

@ -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);