Attempt to fix FS#8077... again

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15441 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2007-11-03 21:57:27 +00:00
parent 0c97493a88
commit 7b74dd7574

View file

@ -550,11 +550,11 @@ static bool buffer_handle(int handle_id)
logf("buffer_handle(%d)", handle_id); logf("buffer_handle(%d)", handle_id);
struct memory_handle *h = find_handle(handle_id); struct memory_handle *h = find_handle(handle_id);
if (!h) if (!h)
return -1; return true;
if (h->filerem == 0) { if (h->filerem == 0) {
/* nothing left to buffer */ /* nothing left to buffer */
return false; return true;
} }
if (h->fd < 0) /* file closed, reopen */ if (h->fd < 0) /* file closed, reopen */
@ -562,10 +562,10 @@ static bool buffer_handle(int handle_id)
if (*h->path) if (*h->path)
h->fd = open(h->path, O_RDONLY); h->fd = open(h->path, O_RDONLY);
else else
return false; return true;
if (h->fd < 0) if (h->fd < 0)
return false; return true;
if (h->offset) if (h->offset)
lseek(h->fd, h->offset, SEEK_SET); lseek(h->fd, h->offset, SEEK_SET);
@ -1189,6 +1189,9 @@ void buffering_thread(void)
case Q_BUFFER_HANDLE: case Q_BUFFER_HANDLE:
LOGFQUEUE("buffering < Q_BUFFER_HANDLE"); LOGFQUEUE("buffering < Q_BUFFER_HANDLE");
queue_reply(&buffering_queue, 1); queue_reply(&buffering_queue, 1);
/* Call buffer callbacks here because this is one of two ways
* to begin a full buffer fill */
call_buffer_low_callbacks();
filling |= buffer_handle((int)ev.data); filling |= buffer_handle((int)ev.data);
break; break;