Skip to content

clock: add back the input (PCR) source

Thomas Guillem requested to merge clock-fixes.1 into master

Hello,

This patch set restore the VLC 3.0 clock behavior when using --clock-master=1.

The option 1 was for MONOTONIC, it's now used for INPUT.

This option can be used by advanced users that want to use the INPUT as the master and have all ES adapting their pace to the input (by resampling, dropping frames, displaying faster...).

When there is no master ES (so no audio enabled), the default master source will now be the INPUT source. Therefore, the VIDEO ES will adapt its pace to the input. Favoring VIDEO or input in that case can be discussed. We can still add another option in --clock-master to always have an output as the master (and avoid modifying the output to adapt to the input).

The input_clock.c that receive PCR points from the demuxer will now be a client of the new vlc_main_clock_t API. It will be considered as master vlc_clock_t, like the active audio ES.

Next input/clock patch set to follow:

  • Fix normal_time handling: only implemented for the ts (and wrongly), pass it directly from the demux to the clocks to the player (and not passing by the input_thread_t)

  • Fix input discontinuities handling. When the clock is reset from the input (in case of discontinuities), outputs ES can't convert their "reset" pts anymore. To address this issue, keep the last clock reference when it is reset from the input. This past reference will be kept until all outputs acknowledge (by calling vlc_clock_Reset() on their side). This will allow output ES to continue outputting frames while the input is reset.

Best regards, Thomas

Edited by Thomas Guillem

Merge request reports