mirror of
https://github.com/u2takey/ffmpeg-go.git
synced 2025-10-06 08:27:06 +08:00
Move platform-specific code under build tags; fix corresponding tests
This commit is contained in:
10
run.go
10
run.go
@@ -9,7 +9,6 @@ import (
|
||||
"os/exec"
|
||||
"sort"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -239,15 +238,6 @@ func (s *Stream) ErrorToStdOut() *Stream {
|
||||
|
||||
type CompilationOption func(s *Stream, cmd *exec.Cmd)
|
||||
|
||||
// SeparateProcessGroup ensures that the command is run in a separate process
|
||||
// group. This is useful to enable handling of signals such as SIGINT without
|
||||
// propagating them to the ffmpeg process.
|
||||
func SeparateProcessGroup() CompilationOption {
|
||||
return func(s *Stream, cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true, Pgid: 0}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Stream) SetFfmpegPath(path string) *Stream {
|
||||
s.FfmpegPath = path
|
||||
return s
|
||||
|
Reference in New Issue
Block a user