Keep a video's loading out of recordings and first frames (#417)
A Start recording right after Play composition still began with empty frames. The composition's clock waited for its video, but the recording went on and took every frame while the video loaded. A clip that starts later in the video also slipped through, because its player already had one picture while it still sought to the clip's start. - The view now counts every video sprite it leaves out as missing, not only one without any first picture. - GameRecorder takes no frame while the game view misses a video, for at most VIDEO_WAIT_MS (3 s) at a time. The recorded time stands and the sound of that time is dropped, so it stays in sync. - RecordingClock.start forgets a hold from before the first frame. Without that, the first real frames all got the time 0. - A followed player starts at 1x until the first speed reading. Before, it paused and sought every frame for about 100 ms, so the first pictures after a wait stuck and then jumped. A step faster than 4x and a time running backwards do not count as a start. - Test hooks: __gm.gameVideo(id) reads the game view's own player, TakeInfo.lastFrameAt shows when the last frame was taken. Tests: - Unit recording (clock after an early hold), video-follow (2 new, 1 adapted): 449 green in tests/core/recording, tests/viewport and tests/core/composition* - e2e 68e (a clip from 0.8 s shows that picture first and then plays), 68f (a recording that already runs takes no frame while the composition's video loads) - 68e is red without the start at 1x, 68f without the hold - README: 2038 editor checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e6b6a4d9a
commit
b2b4cbad28
10 files changed
+213
-25
No files matched your search
@@ -38,13 +38,13 @@ interface Run {
|
||||
id: number;
|
||||
/** By item id. An item a behavior destroyed stays here until it ends, so it is not built again. */
|
||||
live: Map<string, Spawned>;
|
||||
/** Seconds the clock has stood so far for a video without its first picture, see `waits`. */
|
||||
/** Seconds the clock has stood so far for a video without its picture, see `waits`. */
|
||||
waited: number;
|
||||
}
|
||||
|
||||
/** What the view that shows a run knows of its driven videos (#404). */
|
||||
export interface VideoPictures {
|
||||
/** Whether it left the sprite `objectId` out, its video still without a first picture. */
|
||||
/** Whether it did not show the sprite `objectId`, its video still without the picture asked for. */
|
||||
missing(objectId: string): boolean;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface VideoPictures {
|
||||
* frame's `finished`. The editor run plays none: it writes into the saved scene, where the objects of
|
||||
* a cut would stay behind.
|
||||
*
|
||||
* While the view still waits for the first picture of a video an item brings in, the composition's
|
||||
* While the view still waits for the picture of a video an item brings in, the composition's
|
||||
* clock stands, so the video starts at its first frame and not where the clock has got to meanwhile.
|
||||
*/
|
||||
export class CompositionSystem implements System {
|
||||
|
||||
Reference in new issue
Block a user