summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--encode.c1
-rw-r--r--main.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/encode.c b/encode.c
index ba38c6a..5c7e886 100644
--- a/encode.c
+++ b/encode.c
@@ -206,6 +206,7 @@ static bool DrainPacket(const struct AVPacket* packet, int fd) {
switch (result) {
case -1:
if (errno == EINTR) continue;
+ if (errno == EPIPE) return true;
LOG("Failed to write packed (%s)", strerror(errno));
return false;
case 0:
diff --git a/main.c b/main.c
index 50d9df4..8e63703 100644
--- a/main.c
+++ b/main.c
@@ -63,6 +63,7 @@ int main(int argc, char* argv[]) {
(void)argv;
if (signal(SIGINT, OnSignal) == SIG_ERR ||
+ signal(SIGPIPE, OnSignal) == SIG_ERR ||
signal(SIGTERM, OnSignal) == SIG_ERR) {
LOG("Failed to set signal handlers (%s)", strerror(errno));
return EXIT_FAILURE;