From fbb8c376d41692577d292b7f469311d2e1d2beed Mon Sep 17 00:00:00 2001 From: nxshock Date: Tue, 1 Feb 2022 10:02:21 +0500 Subject: [PATCH] Log encoder messages --- streamer.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/streamer.go b/streamer.go index 1eec96f..861a269 100644 --- a/streamer.go +++ b/streamer.go @@ -4,11 +4,12 @@ import ( "errors" "fmt" "io" + "log" "net/http" "os/exec" - "gopkg.in/djherbis/buffer.v1" "github.com/djherbis/nio/v3" + "gopkg.in/djherbis/buffer.v1" ) func stream(url string, w http.ResponseWriter) error { @@ -47,7 +48,10 @@ func encode(url string, w io.Writer) error { } go func() { - cmd.Wait() + err := cmd.Wait() + if err != nil { + log.Println(err) + } }() buf := buffer.New(int64(config.BufferSize) * 1024 * 1024)