]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix an off-by-one bug causing excessive resend requests.
authorMike Brady <mikebrady@eircom.net>
Thu, 17 May 2018 09:58:22 +0000 (10:58 +0100)
committerMike Brady <mikebrady@eircom.net>
Thu, 17 May 2018 09:58:22 +0000 (10:58 +0100)
player.c

index 8e29678aadc429c23c7174334e9f7b8a5f35d28f..32434ed36c3ede8d8aa4b6126488a8d05457f84c 100644 (file)
--- 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) &&