mirror of https://bitbucket.org/ausocean/av.git
revid/webcam.go: fixed error messages in Webcam.Stop
This commit is contained in:
parent
a02ea397d5
commit
9a93e92b50
|
@ -131,11 +131,11 @@ func (w *Webcam) Start() error {
|
|||
// Stop will kill the ffmpeg process and close the output pipe.
|
||||
func (w *Webcam) Stop() error {
|
||||
if w.cmd == nil || w.cmd.Process == nil {
|
||||
return errors.New("raspivid process was never started")
|
||||
return errors.New("ffmpeg process was never started")
|
||||
}
|
||||
err := w.cmd.Process.Kill()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not kill raspivid process: %w", err)
|
||||
return fmt.Errorf("could not kill ffmpeg process: %w", err)
|
||||
}
|
||||
return w.out.Close()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue