Skip to content
Snippets Groups Projects

audio_output: decoder: remove clock reset on drain

Merged Alexandre Janniaux requested to merge alexandre-janniaux/vlc:aout-decoder-drain/1 into master
  1. Jul 14, 2022
    • Alexandre Janniaux's avatar
      audio_output: decoder: remove clock reset on drain · 9a463265
      Alexandre Janniaux authored and Felix Paul Kühne's avatar Felix Paul Kühne committed
      
      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
      
      Co-authored-by: default avatarThomas Guillem <thomas@gllm.fr>
      9a463265
Loading