Browse Source

Daemon

- fix: panic while trying to close already closed channel
Alexey Kim 10 months ago
parent
commit
a3606a3b72
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/daemon/action.go

+ 2 - 2
app/daemon/action.go

@@ -66,6 +66,8 @@ var action = func(ctx *cli.Context) error {
 		}
 	}()
 
+	// usually HLS stream segments have 2s length;
+	//
 	if downloader, err = download.NewHLS(p.HLSStream, time.Second*2); err != nil {
 		return err
 	}
@@ -78,8 +80,6 @@ var action = func(ctx *cli.Context) error {
 			return err
 		case buff := <-chStream:
 			if buff == nil {
-				close(chStream)
-
 				go func() {
 					<-time.After(time.Second * 5)
 					chStream = downloader.Start()