From da02a97a00b110174d25704e1737d8acd14bf16c Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Sun, 20 Aug 2023 18:40:19 +0300 Subject: [PATCH] Fix close for HLS source --- pkg/hls/reader.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/hls/reader.go b/pkg/hls/reader.go index 807bd6cf..a691943b 100644 --- a/pkg/hls/reader.go +++ b/pkg/hls/reader.go @@ -78,6 +78,15 @@ func (r *reader) Read(dst []byte) (n int, err error) { return } +func (r *reader) Close() error { + r.client.Transport = r // after close we fail on next request + return nil +} + +func (r *reader) RoundTrip(_ *http.Request) (*http.Response, error) { + return nil, io.EOF +} + func (r *reader) getSegment() ([]byte, error) { for i := 0; i < 5; i++ { if r.playlist == nil {