diff options
author | Brandon Low <lostlogic@rockbox.org> | 2007-11-05 17:51:55 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2007-11-05 17:51:55 +0000 |
commit | 86830b6566043f4f8fc4b75c802cacbda195f98f (patch) | |
tree | cd56e0b6120fbba28ef66fe79268adb1e00b27fe | |
parent | 76f9bfa9455f14d58f559158c1e343dfe7e5e0ac (diff) |
Create two separate ways for a handle buffer request to be sent. One is when the buffer has gotten low, in this case, we want to start a buffer fill. The other is when the buffer itself requests a buffer as part of a running fill. Obviously this is not a new fill start
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15480 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/buffering.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index 5a67f25038..dc2478ac4c 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -174,8 +174,7 @@ enum { /* Configuration: */ Q_SET_WATERMARK, - Q_SET_CHUNKSIZE, - Q_FILL_BUFFER, /* Request that the buffering thread initiate a buffer + Q_START_FILL, /* Request that the buffering thread initiate a buffer fill at its earliest convenience */ }; @@ -1089,11 +1088,8 @@ ssize_t buf_handle_offset(int handle_id) void buf_request_buffer_handle(int handle_id) { - LOGFQUEUE("buffering >| Q_FILL_BUFFER"); - queue_send(&buffering_queue, Q_FILL_BUFFER, 0); - - LOGFQUEUE("buffering >| Q_BUFFER_HANDLE %d", handle_id); - queue_send(&buffering_queue, Q_BUFFER_HANDLE, handle_id); + LOGFQUEUE("buffering >| Q_START_FILL %d",handle_id); + queue_send(&buffering_queue, Q_START_FILL, handle_id); } void buf_set_base_handle(int handle_id) @@ -1188,19 +1184,20 @@ void buffering_thread(void) switch (ev.id) { - case Q_FILL_BUFFER: - LOGFQUEUE("buffering < Q_FILL_BUFFER"); + case Q_START_FILL: + LOGFQUEUE("buffering < Q_START_FILL"); /* Call buffer callbacks here because this is one of two ways * to begin a full buffer fill */ call_buffer_low_callbacks(); shrink_buffer(); queue_reply(&buffering_queue, 1); + filling |= buffer_handle((int)ev.data); break; case Q_BUFFER_HANDLE: LOGFQUEUE("buffering < Q_BUFFER_HANDLE"); queue_reply(&buffering_queue, 1); - filling |= buffer_handle((int)ev.data); + buffer_handle((int)ev.data); break; case Q_RESET_HANDLE: |