From 40ed76b411a21f8c43afb5c34205cb79d3073fe5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Tue, 2 Apr 2019 16:29:17 +0100 Subject: [PATCH] wait for packets to be received before starting to calculate the nominal remote input rate. --- rtp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rtp.c b/rtp.c index 94de81c2..0e679d66 100644 --- a/rtp.c +++ b/rtp.c @@ -382,8 +382,10 @@ void *rtp_control_receiver(void *arg) { debug_mutex_lock(&conn->reference_time_mutex, 1000, 0); if (conn->initial_reference_time == 0) { - conn->initial_reference_time = remote_time_of_sync; - conn->initial_reference_timestamp = sync_rtp_timestamp; + if (conn->packet_count_since_flush > 50) { + conn->initial_reference_time = remote_time_of_sync; + conn->initial_reference_timestamp = sync_rtp_timestamp; + } } else { uint64_t remote_frame_time_interval = conn->remote_reference_timestamp_time -