Stop the sink memblock leaking upon rewind. Prevent partially played memchunks from getting lost. diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c index 71f1407..a3b69b7 100644 --- a/src/modules/module-solaris.c +++ b/src/modules/module-solaris.c @@ -600,6 +600,8 @@ static void process_rewind(struct userdata *u) { pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes); rewind_nbytes = PA_MIN(u->memchunk.length, rewind_nbytes); u->memchunk.length -= rewind_nbytes; + if (!u->memchunk.length) + pa_memblock_unref(u->memchunk.memblock); pa_log_debug("Rewound %lu bytes.", (unsigned long) rewind_nbytes); } @@ -671,8 +673,8 @@ static void thread_func(void *userdata) { if (len < (size_t) u->minimum_request) break; - if (u->memchunk.length < len) - pa_sink_render(u->sink, len - u->memchunk.length, &u->memchunk); + if (!u->memchunk.length) + pa_sink_render(u->sink, u->sink->thread_info.max_request, &u->memchunk); len = PA_MIN(u->memchunk.length, len);