1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Nicolas Pennequin 2008-07-18 23:26:35 +00:00
parent 70dd64d23d
commit 929d5e9399

View file

@ -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 */