From 91c6a43fc109fa926ded195c31588641d5dd7845 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 10 Nov 2022 07:59:31 -0800 Subject: [PATCH] Fix goal --- stream.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/stream.go b/stream.go index 23a72f5b..a3965382 100644 --- a/stream.go +++ b/stream.go @@ -176,7 +176,6 @@ func (s *Stream) restartAtChunk(w http.ResponseWriter, id int) { // Stop current transcoder if s.coder != nil { s.coder.Process.Kill() - s.coder.Wait() s.coder = nil } @@ -186,7 +185,7 @@ func (s *Stream) restartAtChunk(w http.ResponseWriter, id int) { chunk := s.createChunk(id) // create first chunk // Start the transcoder - s.checkGoal(id) + s.goal = id + 5 s.transcode(id) s.waitForChunk(w, chunk) // this is also a request @@ -299,6 +298,7 @@ func (s *Stream) checkGoal(id int) { // resume encoding if s.coder != nil { + log.Println("Resuming encoding") s.coder.Process.Signal(syscall.SIGCONT) } } @@ -375,10 +375,7 @@ func (s *Stream) monitorTranscodeOutput(cmdStdOut io.ReadCloser, startAt float64 } // Join the process - err := s.coder.Wait() - if err != nil { - log.Println("FFmpeg process wait failed with", err) - } + coder.Wait() } func (s *Stream) monitorStderr(cmdStdErr io.ReadCloser) {