diff options
author | David Henningsson <david.henningsson@canonical.com> | 2013-06-13 14:26:09 +0200 |
---|---|---|
committer | Tanu Kaskinen <tanu.kaskinen@linux.intel.com> | 2013-06-14 13:45:57 +0300 |
commit | 9c4dcffca5c7b31d7ff4ce77146ad87559bf70ef (patch) | |
tree | 8e5bfc06b7e065cd49f166ee0319f3e6f65020ad /src/modules/module-esound-sink.c | |
parent | e2d1421f6184e4fb8bcc694075a0ee26adaf4bee (diff) | |
download | pulseaudio-9c4dcffca5c7b31d7ff4ce77146ad87559bf70ef.tar.gz |
iochannel: Avoid unnecessary wakeup after successful write
To save some CPU (in low latency scenarios), don't re-enable the
"writable" event after it has succeeded. It is very likely the next
write will succeed right away too.
This means that we always need to handle EAGAIN/EWOULDBLOCK as a
successful write of 0 bytes, so I also verified that all callers to
pa_iochannel_write handled this correctly.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Diffstat (limited to 'src/modules/module-esound-sink.c')
-rw-r--r-- | src/modules/module-esound-sink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c index 40ef5bc1d..9cb7a717f 100644 --- a/src/modules/module-esound-sink.c +++ b/src/modules/module-esound-sink.c @@ -345,7 +345,7 @@ static int do_write(struct userdata *u) { if (u->write_data) { pa_assert(u->write_index < u->write_length); - if ((r = pa_iochannel_write(u->io, (uint8_t*) u->write_data + u->write_index, u->write_length - u->write_index)) <= 0) { + if ((r = pa_iochannel_write(u->io, (uint8_t*) u->write_data + u->write_index, u->write_length - u->write_index)) < 0) { pa_log("write() failed: %s", pa_cstrerror(errno)); return -1; } |