summaryrefslogtreecommitdiffstats
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2008-07-18 23:26:35 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2008-07-18 23:26:35 +0000
commit929d5e9399eabead217e69dc7ca009ad4f0f4e6d (patch)
treef622eed58338d6f30426ab55ea46a7d3e47f9951 /apps/buffering.c
parent70dd64d23d9bca166f7d66f102084acba54f9143 (diff)
downloadrockbox-929d5e9399eabead217e69dc7ca009ad4f0f4e6d.tar.gz
rockbox-929d5e9399eabead217e69dc7ca009ad4f0f4e6d.tar.bz2
rockbox-929d5e9399eabead217e69dc7ca009ad4f0f4e6d.zip
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
Diffstat (limited to 'apps/buffering.c')
-rw-r--r--apps/buffering.c2
1 files changed, 1 insertions, 1 deletions
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 */