Skip to content

aout: report timings directly

Thomas Guillem requested to merge tguillem/vlc:latency-cb into master

aout: report timings directly

The current mechanism was made to limit the number of lock/wait from an audio callback.

Nevertheless, it makes the input/decoder.c code more complex, preventing the merge of the 2 mutexes, that could help fix #26915 (closed). Indeed, you can't use the same lock for the audio callback and for calling aout_stream functions.

This commit make the following change: vlc_clock_Update() will be called directly from aout_TimingReport().

Here are the potential mutexes that can be held when calling vlc_clock_Update():

  • The clock mutex
  • The player will likely listen to clock events, and thus, hold a player_timer mutex (but not the player "global" mutex).
  • A gui module or libVLC will likely listen to player timer events, and send these events to the main thread asynchronously (likely one more mutex)

All operations that are executed with theses mutexes held are fast (there is no wait, I/0, big calculation).

Needed by !2144 (merged)

Merge request reports