mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-16 08:56:40 -05:00
pstream: Fixup hangs caused by recent iochannel patch
Now that we don't *always* get a callback after having written something, make sure we can continue writing as long as it fully succeeds. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
parent
2c1dceeb58
commit
b2792d7837
1 changed files with 6 additions and 3 deletions
|
|
@ -187,9 +187,12 @@ static void do_pstream_read_write(pa_pstream *p) {
|
||||||
} else if (!p->dead && pa_iochannel_is_hungup(p->io))
|
} else if (!p->dead && pa_iochannel_is_hungup(p->io))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!p->dead && pa_iochannel_is_writable(p->io)) {
|
while (!p->dead && pa_iochannel_is_writable(p->io)) {
|
||||||
if (do_write(p) < 0)
|
int r = do_write(p);
|
||||||
|
if (r < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
if (r == 0)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pa_pstream_unref(p);
|
pa_pstream_unref(p);
|
||||||
|
|
@ -634,7 +637,7 @@ static int do_write(pa_pstream *p) {
|
||||||
p->drain_callback(p, p->drain_callback_userdata);
|
p->drain_callback(p, p->drain_callback_userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return (size_t) r == l ? 1 : 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue