From: Mike Brady Date: Thu, 17 May 2018 09:58:22 +0000 (+0100) Subject: Fix an off-by-one bug causing excessive resend requests. X-Git-Tag: 3.2RC8~2^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8cd696f8d25c86b4c69727e54c026a55f6cc318;p=thirdparty%2Fshairport-sync.git Fix an off-by-one bug causing excessive resend requests. --- 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) &&