[pulseaudio-discuss] [PATCH] Solaris: debug my latest enbugging, take 2
Lennart Poettering
lennart at poettering.net
Mon Aug 24 18:21:38 PDT 2009
On Tue, 25.08.09 03:47, Finn Thain (fthain at telegraphics.com.au) wrote:
Applied.
Thanks!
> Prevent partially played memchunks from getting lost.
> If the sink has a memblock, don't leak it when rewinding.
>
> 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,10 @@ 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 <= 0 && u->memchunk.memblock) {
> + pa_memblock_unref(u->memchunk.memblock);
> + pa_memchunk_reset(&u->memchunk);
> + }
> pa_log_debug("Rewound %lu bytes.", (unsigned long) rewind_nbytes);
> }
>
> @@ -671,8 +675,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);
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
More information about the pulseaudio-discuss
mailing list