58#define SKEW_THRESHOLD 1500
63static uint32_t adjustment_due_to_skew(uint32_t
ts, uint32_t curr_time)
66 static int first_time = 1;
67 static uint32_t delay_estimate;
68 static uint32_t active_delay;
70 uint32_t d_n =
ts - curr_time;
78 delay_estimate = (31 * delay_estimate + d_n) / 32.0;
84 active_delay = delay_estimate;
86 if ((
double)active_delay - (
double)delay_estimate < -
SKEW_THRESHOLD) {
88 active_delay = delay_estimate;
91 return (uint32_t) ((double)active_delay + (double)adjustment);
96static uint32_t map_local_timeline(uint32_t
ts, uint32_t curr_time)
103 uint32_t new_difference =
ts - curr_time;
106 d[w++] = new_difference;
119 for (i = 1; i < w; i++)
124 for (i = 1; i <
W; i++)