monorepo
Varun Patil 2022-11-10 07:59:31 -08:00
parent c2fd1659ce
commit 91c6a43fc1
1 changed files with 3 additions and 6 deletions

View File

@ -176,7 +176,6 @@ func (s *Stream) restartAtChunk(w http.ResponseWriter, id int) {
// Stop current transcoder // Stop current transcoder
if s.coder != nil { if s.coder != nil {
s.coder.Process.Kill() s.coder.Process.Kill()
s.coder.Wait()
s.coder = nil s.coder = nil
} }
@ -186,7 +185,7 @@ func (s *Stream) restartAtChunk(w http.ResponseWriter, id int) {
chunk := s.createChunk(id) // create first chunk chunk := s.createChunk(id) // create first chunk
// Start the transcoder // Start the transcoder
s.checkGoal(id) s.goal = id + 5
s.transcode(id) s.transcode(id)
s.waitForChunk(w, chunk) // this is also a request s.waitForChunk(w, chunk) // this is also a request
@ -299,6 +298,7 @@ func (s *Stream) checkGoal(id int) {
// resume encoding // resume encoding
if s.coder != nil { if s.coder != nil {
log.Println("Resuming encoding")
s.coder.Process.Signal(syscall.SIGCONT) s.coder.Process.Signal(syscall.SIGCONT)
} }
} }
@ -375,10 +375,7 @@ func (s *Stream) monitorTranscodeOutput(cmdStdOut io.ReadCloser, startAt float64
} }
// Join the process // Join the process
err := s.coder.Wait() coder.Wait()
if err != nil {
log.Println("FFmpeg process wait failed with", err)
}
} }
func (s *Stream) monitorStderr(cmdStdErr io.ReadCloser) { func (s *Stream) monitorStderr(cmdStdErr io.ReadCloser) {