From defba5256901360a00cf91fe20e678990556af6e Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 13 Oct 2020 09:38:44 +0200 Subject: [PATCH] If there is no forwarding, drop forwarding channels --- stream/forwarding/forwarding.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stream/forwarding/forwarding.go b/stream/forwarding/forwarding.go index c6fdf9b..e32316f 100644 --- a/stream/forwarding/forwarding.go +++ b/stream/forwarding/forwarding.go @@ -18,7 +18,9 @@ type Options map[string][]string func Serve(inputChannel chan srt.Packet, cfg Options) { if len(cfg) < 1 { // No forwarding, ignore - return + for { + <-inputChannel // Clear input channel + } } log.Printf("Stream forwarding initialized")