From 42a762da0c1a8ba6baf2fb248cd0a8d448b984d4 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 21 May 2023 13:39:33 +0200 Subject: check errors when signaling the mpv child process --- player.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'player.go') diff --git a/player.go b/player.go index 9b523fe..d5fe270 100644 --- a/player.go +++ b/player.go @@ -46,7 +46,10 @@ func NewPlayer(wrms *Wrms, backends []string) Player { func (player *Player) Play(song *Song) { if player.mpv != nil { llog.Debug("Send SIGCONT to mpv subprocess") - player.mpv.Process.Signal(syscall.SIGCONT) + err := player.mpv.Process.Signal(syscall.SIGCONT) + if err != nil { + llog.Fatal("Failed to send SIGCONT to mpv") + } return } @@ -98,7 +101,10 @@ func (player *Player) PlayData(data io.Reader) { func (player *Player) Pause() { if player.mpv != nil { llog.Debug("Send SIGSTOP to mpv subprocess") - player.mpv.Process.Signal(syscall.SIGSTOP) + err := player.mpv.Process.Signal(syscall.SIGSTOP) + if err != nil { + llog.Fatal("Failed to send SIGSTOP to mpv") + } } } -- cgit v1.2.3