Index: apps/buffering.c =================================================================== --- apps/buffering.c (revision 29826) +++ apps/buffering.c (working copy) @@ -858,6 +858,23 @@ } } +/** -- buffer thread helpers -- **/ +static void shrink_buffer_inner(struct memory_handle *h) +{ + if (h == NULL) + return; + + shrink_buffer_inner(h->next); + + shrink_handle(h); +} + +static void shrink_buffer(void) +{ + logf("shrink_buffer()"); + shrink_buffer_inner(first_handle); +} + #ifdef HAVE_ALBUMART /* Given a file descriptor to a bitmap file, write the bitmap data to the buffer, with a struct bitmap and the actual data immediately following. @@ -1232,9 +1249,10 @@ } /* Now we do the rebuffer */ + shrink_buffer(); queue_reply(&buffering_queue, 0); buffer_handle(handle_id, 0); -} +} /* Backend to bufseek and bufadvance */ static int seek_handle(struct memory_handle *h, size_t newpos) @@ -1600,23 +1618,6 @@ } #endif -/** -- buffer thread helpers -- **/ -static void shrink_buffer_inner(struct memory_handle *h) -{ - if (h == NULL) - return; - - shrink_buffer_inner(h->next); - - shrink_handle(h); -} - -static void shrink_buffer(void) -{ - logf("shrink_buffer()"); - shrink_buffer_inner(first_handle); -} - static void NORETURN_ATTR buffering_thread(void) { bool filling = false;