On Tue, 2014-04-29 at 15:22 +0200, David Henningsson wrote:
> +void pa_pstream_set_srchannel(pa_pstream *p, pa_srchannel *sr) {
> + pa_assert(p);
> + pa_assert(PA_REFCNT_VALUE(p) > 0);
> +
> + if (sr == p->sr)
> + return;
> +
> + /* Make sure we flush the queue, so we don't write half a package on one
> channel and half on the other */
> + while (!p->dead && (do_write(p) > 0 || p->write.current)) {
> + pa_log_debug("Flushing commands before %s srchannel...", sr ?
> "setting up" : "tearing down");
> + }
Is your intention to write all pending packets or just the current
packet? The log message implies the former, but the logic implies the
latter.
What if the write buffer is full? As far as I can see, this will then
busy-loop, and if the other end doesn't read, this will busy-loop
forever.
--
Tanu
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss