From 33ee6bfc66254e98e7500f8f2613ae0a4d19d87b Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 3 Oct 2014 12:33:59 +0100 Subject: Hangup the call on EPIPE If you want to switch to another call or want to change the output device, simply attach another program on the FIFO and kill the first. This could be another instance of aplay/aucat or simply cat. --- ratox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 50ecfa0..2842f8c 100644 --- a/ratox.c +++ b/ratox.c @@ -474,7 +474,8 @@ cbcalldata(ToxAv *av, int32_t cnum, int16_t *data, int len, void *udata) n = write(f->fd[FCALL_OUT], &buf[wrote], len); if (n < 0) { if (errno == EPIPE) { - /* TODO: terminate call here */ + toxav_hangup(toxav, 0); + cancelrxcall(f, "Hangup"); break; } else if (errno == EWOULDBLOCK) { continue; @@ -501,7 +502,6 @@ cancelrxcall(struct friend *f, char *action) dprintf(f->fd[FCALL_PENDING], "0\n"); } - static void cbconnstatus(Tox *m, int32_t frnum, uint8_t status, void *udata) { -- cgit v1.2.3