summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-10-03 12:33:59 +0100
committersin <sin@2f30.org>2014-10-03 12:33:59 +0100
commit33ee6bfc66254e98e7500f8f2613ae0a4d19d87b (patch)
tree54113ed442f900b3e6d71e90cffc333eed294eae /ratox.c
parent328d8f718c2b53edeb7a953f2666977876e23cd1 (diff)
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.
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c4
1 files changed, 2 insertions, 2 deletions
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)
{