Skip to content

clock: fix audio/video synchronisation issues

Thomas Guillem requested to merge tguillem/vlc:timeget2 into master

This MR aim to fix #27023 (closed)

I decided to report more precise timing points from all audio outputs instead of trying to use a different mathematical function to "smooth" the clock average. This solution might be possible, but will always be less precise.

This MR is divided in two parts:

  • The core part
  • PulseAudio changes

I also tested it with all main aout modules (apple, android AAudio, Wasapi). If accepted, I will implement aout_TimingReport for all these modules.

The result ! Clock offset measurement in most common situation with this MR:

A/V sync is perfect and quick to stabilize, even with BT devices, no video drops reported in logs.

Compare with #27023 (closed)

PulseAudio with a BT device, playing a 25fps video (23ms audio sample)

fixed-25fps-bt

PulseAudio with a BT device, playing a 60fps video (10ms audio sample)

fixed-60fps-bt

PulseAudio with a speaker, playing a 25fps video (23ms audio sample)

fixed-25fps-speaker

PulseAudio with a speaker, playing a 60fps video (10ms audio sample)

fixed-60fps-speaker

Merge request reports