summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2008-07-11 12:44:27 +0000
committerMagnus Holmgren <magnushol@gmail.com>2008-07-11 12:44:27 +0000
commit7c84ede3781c27db73403bd6302f320c76a58c8c (patch)
tree2da71a63b06047a20c5db129070cc804d99fd63a
parentaae69dff459324496ddf6df445f0b1e5a0d5cdf3 (diff)
downloadrockbox-7c84ede3781c27db73403bd6302f320c76a58c8c.tar.gz
rockbox-7c84ede3781c27db73403bd6302f320c76a58c8c.zip
Hopefully fix FS #9153, as well as another bug (in fill_buffer) that could cause problems when rebuffering.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18009 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/buffering.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index c3687e83a3..588d98f30e 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -689,7 +689,7 @@ static void reset_handle(int handle_id)
689 if (!h) 689 if (!h)
690 return; 690 return;
691 691
692 h->widx = h->data; 692 h->ridx = h->widx = h->data;
693 if (h == cur_handle) 693 if (h == cur_handle)
694 buf_widx = h->widx; 694 buf_widx = h->widx;
695 h->available = 0; 695 h->available = 0;
@@ -735,8 +735,6 @@ static void rebuffer_handle(int handle_id, size_t newpos)
735 /* Now we ask for a rebuffer */ 735 /* Now we ask for a rebuffer */
736 LOGFQUEUE("buffering >| Q_BUFFER_HANDLE"); 736 LOGFQUEUE("buffering >| Q_BUFFER_HANDLE");
737 queue_send(&buffering_queue, Q_BUFFER_HANDLE, handle_id); 737 queue_send(&buffering_queue, Q_BUFFER_HANDLE, handle_id);
738
739 h->ridx = h->data;
740} 738}
741 739
742static bool close_handle(int handle_id) 740static bool close_handle(int handle_id)
@@ -814,8 +812,9 @@ static void shrink_handle(struct memory_handle *h)
814static bool fill_buffer(void) 812static bool fill_buffer(void)
815{ 813{
816 logf("fill_buffer()"); 814 logf("fill_buffer()");
817 struct memory_handle *m = first_handle; 815 struct memory_handle *m;
818 shrink_handle(m); 816 shrink_handle(first_handle);
817 m = first_handle;
819 while (queue_empty(&buffering_queue) && m) { 818 while (queue_empty(&buffering_queue) && m) {
820 if (m->filerem > 0) { 819 if (m->filerem > 0) {
821 if (!buffer_handle(m->id)) { 820 if (!buffer_handle(m->id)) {