From a8cd696f8d25c86b4c69727e54c026a55f6cc318 Mon Sep 17 00:00:00 2001 From: Mike Brady Date: Thu, 17 May 2018 10:58:22 +0100 Subject: [PATCH] Fix an off-by-one bug causing excessive resend requests. --- player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player.c b/player.c index 8e29678a..32434ed3 100644 --- a/player.c +++ b/player.c @@ -535,7 +535,7 @@ void player_put_packet(seq_t seqno, uint32_t actual_timestamp, int64_t timestamp int k; for (k = -2; k <= 2; k++) { if ((back_step + k) < sd) { // if it's within the range of frames in use... - int item_to_check = (conn->ab_write - back_step + k) & 0xffff; + int item_to_check = (conn->ab_write - (back_step + k)) & 0xffff; seq_t next = item_to_check; abuf_t *check_buf = conn->audio_buffer + BUFIDX(next); if ((!check_buf->ready) &&