This is needed for Starship Titanic, where videos can have a secondary
video track. It was simpler to use the callback as a means to select
one video track each across two decoders than trying to make VideoDecoder
and/or AVIDecoder support decoding from multiple video tracks simultaneously
Starship Titanic in particular needs this, since some of the videos
have extra junk at the end of the file, such as ycursors.avi,
and parsing fails if we don't respect the filesize field
In SSCI, VMD is drawn by a standard CelObjMem wrapped by a
ScreenItem, giving the location of the bitmap memory to the
decoder. The decoder already supports this, but the API was
previously hidden behind the AdvancedVMDDecoder wrapper
(which is more convenient to use than the VMDDecoder class).
We don't support playing videos with multiple edits backwards. Taking the code
path to move to the next edit when playing backwards sets the current edit index
to an invalid value with the video still trying to play. Which results in out of
bounds reads, and ultimately a crash.
This fixes multiple crashes in Myst. Using the key without the chest on
Stoneship, resetting the clock tower puzzle, and using the switch in the trees
in Channelwood.
This was a regression introduced in a59f5db505.
If seeking to the final frame of an edit, _nextFrameStartTime wouldn't be adjust properly and would wrongly say that it's at the end of the edit. This never affected anything because of the edit "-1" hack.
Relying on the videos to have 'initial frames' for audio tracks is not the best way to handle AVI videos. Now videos without initial frames (or broken interleaving) will buffer properly.
This is used in German release of Full Pipe. Unfortunately our
current MP3 decoder cannot work with streamed MP3s, and bails out
at the AVI header since there is no full MP3 header yet.
Truemotion uses its own demuxer and seems to follow its own AVI rules. Work around it by coercing the video's dimensions to use the codec's internal dimensions.
The code currenly has 4 logically dead lines. Instead of requiring
both newWidth and newHeight to be non zero, just make sure one of
them is non zero and set the other one to the current size.