From 67a19bf3c9e0a54515138f1bfeb7205bcf5378d5 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Mon, 7 Jan 2019 15:59:58 +0000 Subject: [PATCH] Make the wait time less than the packet interval time to enable SPS to catch up if it gets behind. --- player.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player.c b/player.c index a085a636..3bab2428 100644 --- a/player.c +++ b/player.c @@ -1198,8 +1198,8 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { if (wait) { uint64_t time_to_wait_for_wakeup_fp = ((uint64_t)1 << 32) / conn->input_rate; // this is time period of one frame - time_to_wait_for_wakeup_fp *= 4 * 352; // four full 352-frame packets - time_to_wait_for_wakeup_fp /= 3; // four thirds of a packet time + time_to_wait_for_wakeup_fp *= 2 * 352; // two full 352-frame packets + time_to_wait_for_wakeup_fp /= 3; // two thirds of a packet time #ifdef COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN_AND_OPENBSD uint64_t time_of_wakeup_fp = local_time_now + time_to_wait_for_wakeup_fp;