[vlc-devel] [PATCH 2/3] clock: move SetDejitter to the main clock
Jean-Baptiste Kempf
jb at videolan.org
Thu Dec 5 11:26:05 CET 2019
OK.
On Thu, Dec 5, 2019, at 10:46, Thomas Guillem wrote:
> This function was unused, was only working for the master clock and impacted
> the main_clock.
> ---
> src/clock/clock.c | 31 ++++++++-----------------------
> src/clock/clock.h | 15 ++++++++-------
> 2 files changed, 16 insertions(+), 30 deletions(-)
>
> diff --git a/src/clock/clock.c b/src/clock/clock.c
> index 9751a3c2def..43c44bed6e4 100644
> --- a/src/clock/clock.c
> +++ b/src/clock/clock.c
> @@ -65,7 +65,6 @@ struct vlc_clock_t
> unsigned frame_rate, unsigned frame_rate_base);
> void (*reset)(vlc_clock_t *clock);
> vlc_tick_t (*set_delay)(vlc_clock_t *clock, vlc_tick_t delay);
> - void (*set_dejitter)(vlc_clock_t *clock, vlc_tick_t delay);
> vlc_tick_t (*to_system_locked)(vlc_clock_t *clock, vlc_tick_t system_now,
> vlc_tick_t ts, double rate);
>
> @@ -222,15 +221,6 @@ static vlc_tick_t
> vlc_clock_master_set_delay(vlc_clock_t *clock, vlc_tick_t dela
> return delta;
> }
>
> -static void vlc_clock_master_set_dejitter(vlc_clock_t *clock,
> vlc_tick_t delay)
> -{
> - vlc_clock_main_t *main_clock = clock->owner;
> -
> - vlc_mutex_lock(&main_clock->lock);
> - main_clock->output_dejitter = delay;
> - vlc_mutex_unlock(&main_clock->lock);
> -}
> -
> static vlc_tick_t
> vlc_clock_monotonic_to_system_locked(vlc_clock_t *clock, vlc_tick_t
> now,
> vlc_tick_t ts, double rate)
> @@ -366,12 +356,6 @@ int vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t
> system_now, vlc_tick_t ts,
> return -1;
> }
>
> -static void vlc_clock_slave_set_dejitter(vlc_clock_t *clock,
> vlc_tick_t delay)
> -{
> - VLC_UNUSED(clock);
> - VLC_UNUSED(delay);
> -}
> -
> vlc_clock_main_t *vlc_clock_main_New(void)
> {
> vlc_clock_main_t *main_clock = malloc(sizeof(vlc_clock_main_t));
> @@ -445,6 +429,14 @@ void
> vlc_clock_main_SetInputDejitter(vlc_clock_main_t *main_clock,
> vlc_mutex_unlock(&main_clock->lock);
> }
>
> +void vlc_clock_main_SetDejitter(vlc_clock_main_t *main_clock,
> + vlc_tick_t dejitter)
> +{
> + vlc_mutex_lock(&main_clock->lock);
> + main_clock->output_dejitter = dejitter;
> + vlc_mutex_unlock(&main_clock->lock);
> +}
> +
> void vlc_clock_main_ChangePause(vlc_clock_main_t *main_clock,
> vlc_tick_t now,
> bool paused)
> {
> @@ -528,17 +520,11 @@ void vlc_clock_ConvertArrayToSystem(vlc_clock_t
> *clock, vlc_tick_t system_now,
> vlc_mutex_unlock(&main_clock->lock);
> }
>
> -void vlc_clock_SetDejitter(vlc_clock_t *clock, vlc_tick_t delay)
> -{
> - clock->set_dejitter(clock, delay);
> -}
> -
> static void vlc_clock_set_master_callbacks(vlc_clock_t *clock)
> {
> clock->update = vlc_clock_master_update;
> clock->reset = vlc_clock_master_reset;
> clock->set_delay = vlc_clock_master_set_delay;
> - clock->set_dejitter = vlc_clock_master_set_dejitter;
> clock->to_system_locked = vlc_clock_master_to_system_locked;
> }
>
> @@ -547,7 +533,6 @@ static void
> vlc_clock_set_slave_callbacks(vlc_clock_t *clock)
> clock->update = vlc_clock_slave_update;
> clock->reset = vlc_clock_slave_reset;
> clock->set_delay = vlc_clock_slave_set_delay;
> - clock->set_dejitter = vlc_clock_slave_set_dejitter;
> clock->to_system_locked = vlc_clock_slave_to_system_locked;
> }
>
> diff --git a/src/clock/clock.h b/src/clock/clock.h
> index fcb1f84975e..87faab165e8 100644
> --- a/src/clock/clock.h
> +++ b/src/clock/clock.h
> @@ -79,6 +79,14 @@ void vlc_clock_main_SetFirstPcr(vlc_clock_main_t *main_clock,
> void vlc_clock_main_SetInputDejitter(vlc_clock_main_t *main_clock,
> vlc_tick_t delay);
>
> +/**
> + * This function sets the dejitter delay to absorb the clock jitter
> + *
> + * Also used as the maximum delay before the synchro is considered to
> kick in.
> + */
> +void vlc_clock_main_SetDejitter(vlc_clock_main_t *main_clock,
> vlc_tick_t dejitter);
> +
> +
> /**
> * This function allows changing the pause status.
> */
> @@ -176,11 +184,4 @@ void vlc_clock_ConvertArrayToSystem(vlc_clock_t
> *clock, vlc_tick_t system_now,
> vlc_tick_t *ts_array, size_t
> ts_count,
> double rate);
>
> -/**
> - * This function sets the dejitter delay to absorb the clock jitter
> - *
> - * Also used as the maximum delay before the synchro is considered to kick in.
> - */
> -void vlc_clock_SetDejitter(vlc_clock_t *clock, vlc_tick_t delay);
> -
> #endif /*VLC_CLOCK_H*/
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
Jean-Baptiste Kempf - President
+33 672 704 734
More information about the vlc-devel
mailing list