"Sequencer.AllowPausedClock 1" can result in negative CurrentSequenceTimeSeconds

This question was created in reference to: [SetGamePause affecting Sequencer [Content removed]

After cherry-picking the fix for https://issues.unrealengine.com/issue/UE\-350536 (CL 48160863), sometimes LevelSequences would apparently hang or skip at the beginning.

If the player pauses the game, unpauses, then starts a LevelSequence, CurrentSequenceTimeSeconds starts negative for the time spent in pause (for the current world). I expect this should be accumulating PausedTime only during the Sequence.

Locally we have a potential fix by tracking the paused time that occurred while the time controller is started:

  • in FMovieSceneTimeController_ExternalClock::OnStartPlaying: PausedTimeStart = GetPausedTime();
  • in OnRequestCurrentTime: PausedTime = GetPausedTime() - PausedTimeStart;

Where GetPausedTime is the CVarSequencerAllowPausedClock block refactored as a function.

[Attachment Removed]

Steps to Reproduce
With the fix for https://issues.unrealengine.com/issue/UE\-350536 (CL 48160863; and “Sequencer.AllowPausedClock 1”):

  1. Create a LevelSequence with Audio clock source “MyLevelSequence”
  2. Start PIE
  3. Pause for a while then unpause
  4. console: Log LogMovieScene VeryVerbose
  5. console: Sequencer Play MyLevelSequence
  6. observe:
    1. the Sequence starts but holds for a while (or has other unexpected behavior on start)
    2. Sequence Offset Seconds and Sequence Now are both negative and count up to 0: LogMovieScene: VeryVerbose: TimeController … Sequence Start Time: frame 0, subframe 0.000000, Sequence Offset Seconds: -12.734930, Sequence Now: frame -383, subframe 0.952089

[Attachment Removed]

Hey there,

That seems like a good change, can you submit a PR for this?

Dustin

[Attachment Removed]