diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-05-28 19:34:36 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-05-28 19:34:36 +0200 |
| commit | 6fef9c693b98bd8c2bf63162baedeb5123e963f3 (patch) | |
| tree | b749cb3adc2a082e2128e49984f4beb414591b05 /player.go | |
| parent | dadf23a40cfa2eff2e5caa5c1edd24a6b550e95a (diff) | |
| download | WRMS-6fef9c693b98bd8c2bf63162baedeb5123e963f3.tar.gz WRMS-6fef9c693b98bd8c2bf63162baedeb5123e963f3.zip | |
support custom mpv flags
Diffstat (limited to 'player.go')
| -rw-r--r-- | player.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -3,6 +3,7 @@ package main import ( "io" "os/exec" + "strings" "sync" "syscall" @@ -76,9 +77,18 @@ func (player *Player) runMpv() { wrms.Next() } +const MPV_FLAGS = "--no-video" + func (player *Player) PlayUri(uri string) { llog.Info("Start mpv with %s", uri) - player.mpv = exec.Command("mpv", "--no-video", uri) + cmd := []string{"mpv", uri} + + cmd = append(cmd, strings.Split(MPV_FLAGS, " ")...) + + cmd = append(cmd, strings.Split(wrms.Config.MpvFlags, " ")...) + + llog.Debug("Running '%s'", strings.Join(cmd, " ")) + player.mpv = exec.Command("mpv", cmd...) go player.runMpv() } |
