From 90ce2e0b4c5acd084e131acc6875364db86f1192 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 10 Dec 2017 01:25:00 +0100 Subject: [PATCH 1/2] No longer disconnect on deleteStream --- src/output/output_rtmp.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/output/output_rtmp.cpp b/src/output/output_rtmp.cpp index 18debad1..2de5e217 100644 --- a/src/output/output_rtmp.cpp +++ b/src/output/output_rtmp.cpp @@ -507,7 +507,6 @@ namespace Mist { } if (amfData.getContentP(0)->StrValue() == "deleteStream"){ stop(); - onFinish(); return; } if ((amfData.getContentP(0)->StrValue() == "FCUnpublish") || (amfData.getContentP(0)->StrValue() == "releaseStream")){ From c69adc26b90959d2bcc374fcc7bd7ccbddb61e1b Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 10 Dec 2017 18:21:43 +0100 Subject: [PATCH 2/2] Fixed shared memory master-mode re-opens causing SIGBUS errors in other parts --- lib/shared_memory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/shared_memory.cpp b/lib/shared_memory.cpp index a0b44b90..8567fbdf 100644 --- a/lib/shared_memory.cpp +++ b/lib/shared_memory.cpp @@ -459,10 +459,6 @@ namespace IPC { return; } if (master) { - if (ftruncate(handle, 0) < 0) { - FAIL_MSG("truncate to zero for page %s failed: %s", name.c_str(), strerror(errno)); - return; - } if (ftruncate(handle, len) < 0) { FAIL_MSG("truncate to %lld for page %s failed: %s", len, name.c_str(), strerror(errno)); return; @@ -474,6 +470,10 @@ namespace IPC { return; } len = buffStats.st_size; + if (!len){ + mapped = 0; + return; + } } mapped = (char *)mmap(0, len, PROT_READ | PROT_WRITE, MAP_SHARED, handle, 0); if (mapped == MAP_FAILED) {