Skip to content

ges: timeline: synchronize flushing downstream across all tracks during flushing seeks

Implemented flushing synchronization downstream across all tracks when performing a flushing seek operation in GESTimeline.

This fixes a race condition when seeking on a pipeline that uses a streamsynchronizer after a timeline where the following scenario was happening:

video_nlecomposition0 gets an EOS for its current stack so we start a new stack
  -> A new segment flows with a .base=8.791
  -> We now have streamsynchronizer::sink_0(video).segment.base = 8.791

audio_nlecomposition1 gets a seek event
  -> flush_start is outputted
  -> flush_stop is outputted and reaches streamsynchronizer::sink_1(audio)
      => Now `streamsynchronizer` uses sink_0.segment.start.running_time() for group_stream_start_time = 8.791
  -> A new segment resulting from the seek flows, and streamsynchronizer sets `.base =  8.791`

  =>  A buffer flows trough and reaches the sink, and the sink will wait for running_time = 8.791
    before rendering it, while it should not have waited at all!

video_nlecomposition0 gets the seek only then

The fix makes it so the timeline ensures that the FLUSH_START coming from the first composition to be executing the seek is forwarding to all its srcpad ensuring the streamsynchronizer::sink_1(video).segment is reset as needed.

Merge request reports