summaryrefslogtreecommitdiffstats
path: root/src/iochannel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-07-09 23:26:10 +0000
committerLennart Poettering <lennart@poettering.net>2004-07-09 23:26:10 +0000
commitcffc7768bd5b8d16308c15102b4d03d08d287098 (patch)
tree389f6035e787b8e2106862d77718cc9dc4f140b6 /src/iochannel.c
parent863fb90d90c2e57e60a0f5b81e0847319399b8ed (diff)
fix recording for simpel and esound protocols
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@54 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/iochannel.c')
-rw-r--r--src/iochannel.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/iochannel.c b/src/iochannel.c
index afa94cff..775c6139 100644
--- a/src/iochannel.c
+++ b/src/iochannel.c
@@ -15,6 +15,7 @@ struct pa_iochannel {
int readable;
int writable;
+ int hungup;
int no_close;
@@ -47,6 +48,11 @@ static void callback(struct pa_mainloop_api* m, void *id, int fd, enum pa_mainlo
int changed = 0;
assert(m && fd >= 0 && events && userdata);
+ if ((events & PA_MAINLOOP_API_IO_EVENT_HUP) && !io->hungup) {
+ io->hungup = 1;
+ changed = 1;
+ }
+
if ((events & PA_MAINLOOP_API_IO_EVENT_INPUT) && !io->readable) {
io->readable = 1;
changed = 1;
@@ -80,6 +86,7 @@ struct pa_iochannel* pa_iochannel_new(struct pa_mainloop_api*m, int ifd, int ofd
io->callback = NULL;
io->readable = 0;
io->writable = 0;
+ io->hungup = 0;
io->no_close = 0;
if (ifd == ofd) {
@@ -132,6 +139,11 @@ int pa_iochannel_is_writable(struct pa_iochannel*io) {
return io->writable;
}
+int pa_iochannel_is_hungup(struct pa_iochannel*io) {
+ assert(io);
+ return io->hungup;
+}
+
ssize_t pa_iochannel_write(struct pa_iochannel*io, const void*data, size_t l) {
ssize_t r;
assert(io && data && l && io->ofd >= 0);
@@ -168,7 +180,17 @@ void pa_iochannel_set_noclose(struct pa_iochannel*io, int b) {
io->no_close = b;
}
-void pa_iochannel_peer_to_string(struct pa_iochannel*io, char*s, size_t l) {
+void pa_iochannel_socket_peer_to_string(struct pa_iochannel*io, char*s, size_t l) {
assert(io && s && l);
pa_peer_to_string(s, l, io->ifd);
}
+
+int pa_iochannel_socket_set_rcvbuf(struct pa_iochannel *io, size_t l) {
+ assert(io);
+ return pa_socket_set_rcvbuf(io->ifd, l);
+}
+
+int pa_iochannel_socket_set_sndbuf(struct pa_iochannel *io, size_t l) {
+ assert(io);
+ return pa_socket_set_sndbuf(io->ofd, l);
+}