residual/residual — Issue #399: GRIM: Video playback hangs at the end of the sailing sequence.
Author: juj
Created: 2011-10-29 12:53:56+00:00
State: open

Deterministically reproducible:
1. Load this savegame: http://dl.dropbox.com/u/40949268/grim51.gsv
2. Go up to Manny's office, click on his work desk. Remove the rigging on the number two in roulette.
You will see the cutscene on Manny and Glottis entering the boat.
3. Watch the videos *without skipping*.

The video playback will hang (apparently at the very end of the video playback sequence). The screen looks like this at the time of hang: http://dl.dropbox.com/u/40949268/VideoPlaybackHang1.png. Just right after the video hangs, static noise will be output from the speakers for about half a second, before the audio cuts as well.

Breaking to debugger at the time of hang looks like this http://dl.dropbox.com/u/40949268/VideoPlaybackHang2.png

Stepping through the debugger, the cause of the hang is obvious: The loop shown in the second screenshot does not meet a proper tag "Bl16" or "Wave", the contents of the stream is shown in the Watch 1 window, and doesn't seem to contain a proper tag element at the given position.

While the problem is either
1. The video decoder has corrupted its decoding process previously, and mis-synced the decoding stream, therefore skipping the start position of the proper tag here, or
2. My data files are corrupt here,
it should still be worthwhile to fix that loop shown in the second screenshot not to do a livelock even if 1) or 2) has occurred above.