[vlc-devel] [PATCH] clock: check condition before calculation
Thomas Guillem
thomas at gllm.fr
Fri May 22 09:03:20 CEST 2020
merged, thanks!
On Wed, May 20, 2020, at 17:28, Zhao Zhili wrote:
> ---
> src/clock/clock.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/clock/clock.c b/src/clock/clock.c
> index f373460abe..26e380b439 100644
> --- a/src/clock/clock.c
> +++ b/src/clock/clock.c
> @@ -132,12 +132,12 @@ static vlc_tick_t
> vlc_clock_master_update(vlc_clock_t *clock,
> if (main_clock->offset != VLC_TICK_INVALID
> && ts != main_clock->last.stream)
> {
> - /* We have a reference so we can update coeff */
> - double instant_coeff = (system_now -
> main_clock->last.system)
> - / (double)(ts -
> main_clock->last.stream);
> if (rate == main_clock->rate)
> {
> - instant_coeff *= rate;
> + /* We have a reference so we can update coeff */
> + double instant_coeff = (system_now -
> main_clock->last.system)
> + / (double)(ts -
> main_clock->last.stream)
> + * rate;
> AvgUpdate(&main_clock->coeff_avg, instant_coeff);
> main_clock->coeff = AvgGet(&main_clock->coeff_avg);
> }
> --
> 2.25.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list