summaryrefslogtreecommitdiffstats
path: root/src/polypcore/protocol-esound.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-05-11 22:37:42 +0000
committerLennart Poettering <lennart@poettering.net>2006-05-11 22:37:42 +0000
commit11782f0b749e261a6241570dc160075e9baf0a93 (patch)
tree91c13ddc5a2676a7b7c412c44b1fbd1ee6cd01c4 /src/polypcore/protocol-esound.c
parenteecc04cf282392afb624fb14ab4f6a564bab4875 (diff)
fix hangup detection for recording streams
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@849 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/polypcore/protocol-esound.c')
-rw-r--r--src/polypcore/protocol-esound.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/polypcore/protocol-esound.c b/src/polypcore/protocol-esound.c
index 2c956a7e..7a6861fd 100644
--- a/src/polypcore/protocol-esound.c
+++ b/src/polypcore/protocol-esound.c
@@ -58,7 +58,7 @@
#define DEFAULT_COOKIE_FILE ".esd_auth"
-#define PLAYBACK_BUFFER_SECONDS (.5)
+#define PLAYBACK_BUFFER_SECONDS (.25)
#define PLAYBACK_BUFFER_FRAGMENTS (10)
#define RECORD_BUFFER_SECONDS (5)
#define RECORD_BUFFER_FRAGMENTS (100)
@@ -985,7 +985,12 @@ static void do_work(struct connection *c) {
if (pa_iochannel_is_readable(c->io)) {
if (do_read(c) < 0)
goto fail;
- } else if (pa_iochannel_is_hungup(c->io))
+ }
+
+ if (c->state == ESD_STREAMING_DATA && c->source_output && pa_iochannel_is_hungup(c->io))
+ /* In case we are in capture mode we will never call read()
+ * on the socket, hence we need to detect the hangup manually
+ * here, instead of simply waiting for read() to return 0. */
goto fail;
if (pa_iochannel_is_writable(c->io))
@@ -1008,13 +1013,10 @@ fail:
connection_free(c);
}
-
static void io_callback(pa_iochannel*io, void *userdata) {
struct connection *c = userdata;
assert(io && c && c->io == io);
-/* pa_log("IO"); */
-
do_work(c);
}