Skip to content

audio_output: decoder: remove clock reset on drain

After commit 0dd8096f made the drain asynchronous, the clock at the end of the drain can be reset before the end of the playback.

When finishing an input while draining asynchronously the audio and video, it means that the clock can become invalidated and unusable if the audio terminates before the video.

The video will then switch to the monotonic fallback, which is currently not synchronized in offset with the master clock, and would lead to a huge gap in time for the next picture being displayed, deferring as much the draining of the video output.

The normal processing should be first to drain the decoder, and when everything has been pushed, to first flush the decoder if a clock reset is needed.

It was breaking the test_src_player::test_titles by randomly creating a wait time of more than 90 seconds for the penultimate picture in the video output, deferring the end of the test by that much. Now the clock will stay valid with constant parameters until the end of all the tracks.

Note that it does not fix the problem where the master clock has finished, but we seek later in the file, which is a different synchronization issue.

Fixes #27106 (closed)

Co-authored-by: Thomas Guillem

Edited by Alexandre Janniaux

Merge request reports