diff options
-rw-r--r-- | apps/buffering.c | 9 |
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 | ||
742 | static bool close_handle(int handle_id) | 740 | static bool close_handle(int handle_id) |
@@ -814,8 +812,9 @@ static void shrink_handle(struct memory_handle *h) | |||
814 | static bool fill_buffer(void) | 812 | static 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)) { |