From 929d5e9399eabead217e69dc7ca009ad4f0f4e6d Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Fri, 18 Jul 2008 23:26:35 +0000 Subject: [PATCH] Fix FS#9137 and FS#8194 (the end of a track is cut off after rebuffering): the cause was a confusion between regular subtraction and subtraction in a ring-buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18090 a1c6a512-1295-4272-9138-f99709370657 --- apps/buffering.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/buffering.c b/apps/buffering.c index 588d98f30e..30601481e4 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -724,7 +724,7 @@ static void rebuffer_handle(int handle_id, size_t newpos) queue_send(&buffering_queue, Q_RESET_HANDLE, handle_id); size_t next = (unsigned)((void *)h->next - (void *)buffer); - if (next - h->data < h->filesize - newpos) + if (RINGBUF_SUB(next, h->data) < h->filesize - newpos) { /* There isn't enough space to rebuffer all of the track from its new offset, so we ask the user to free some */