Checking for total free buffer space isn't correct. What we need to check is the space available for the particular handle we want to rebuffer.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15821 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nicolas Pennequin 2007-11-26 23:51:36 +00:00
parent 120fb4f319
commit 774fd19c37

View file

@ -706,10 +706,11 @@ static void rebuffer_handle(int handle_id, size_t newpos)
LOGFQUEUE("buffering >| Q_RESET_HANDLE");
queue_send(&buffering_queue, Q_RESET_HANDLE, handle_id);
/* There isn't enough space to rebuffer all of the track from its new
offset, so we ask the user to free some */
if (buffer_len - BUF_USED < h->filesize - newpos)
size_t next = (unsigned)((void *)h->next - (void *)buffer);
if (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 */
DEBUGF("rebuffer_handle: space is needed\n");
call_buffering_callbacks(EVENT_HANDLE_REBUFFER, handle_id);
}