From 7f2aa1607cad9ea53ad258a2e6a1f8362971639d Mon Sep 17 00:00:00 2001 From: Wessie Date: Wed, 19 Jun 2024 23:01:08 +0100 Subject: [PATCH] streamer: close the trackCh when encoder exits --- streamer/streamer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/streamer/streamer.go b/streamer/streamer.go index c4c250f..ac34e83 100644 --- a/streamer/streamer.go +++ b/streamer/streamer.go @@ -295,6 +295,7 @@ func (s *Streamer) start(ctx context.Context, // routine, we make a separately cancelable context ctx, cancel := context.WithCancel(ctx) defer cancel() + defer close(trackCh) // store the cancel in the struct so it's accessable from Stop s.mu.Lock()