Skip to content

Commit

Permalink
add hls ffmpeg coder withou parametrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman SHamagin committed Aug 19, 2023
1 parent bb68374 commit c2aecf6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ func (c *Config) m3u8ReverseProxy(ctx *gin.Context) {
}
lastRequestTimer = time.AfterFunc(1*time.Minute, func() {
if currentProcess != nil {
currentProcess.Cmd.Process.Kill()
currentProcess.Cmd.Process.Wait()
err := currentProcess.Cmd.Process.Kill()
if err != nil {
return
}
_, _ = currentProcess.Cmd.Process.Wait()
removeDirectoryFromPath(currentProcess.LastPath)
currentProcess = nil
}
Expand Down Expand Up @@ -210,7 +213,9 @@ func ModifyAndSendPlaylist(ctx *gin.Context, outputPath string) {
if err != nil {
log.Fatal(err)
}
defer file.Close()
defer func(file *os.File) {
_ = file.Close()
}(file)

// Декодируйте содержимое файла
p, listType, err := m3u8.DecodeFrom(bufio.NewReader(file), true)
Expand Down

0 comments on commit c2aecf6

Please sign in to comment.