Skip to content

Commit

Permalink
omxplayer.go: run omxplayer with priority -15
Browse files Browse the repository at this point in the history
  • Loading branch information
Cezarus27 committed Nov 29, 2021
1 parent fec94ca commit 0c0cf13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions omxplayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func getDbusConnection() (conn *dbus.Conn, err error) {
dbus.AuthExternal(user),
dbus.AuthCookieSha1(user, home),
}

log.Debug("omxplayer: opening dbus session")
if conn, err = dbus.SessionBusPrivate(); err != nil {
return
Expand Down Expand Up @@ -153,14 +152,16 @@ func setupDbusEnvironment() (err error) {
return
}

// Run omxplayer with high priority using "nice" shell command
// execOmxplayer starts a new OMXPlayer process and tells it to pause the video
// by passing a "p" on standard input.
func execOmxplayer(url string, args ...string) (cmd *exec.Cmd, err error) {
log.Debug("omxplayer: starting omxplayer process")

args = append(args, url)

cmd = exec.Command(exeOxmPlayer, args...)
n_args := []string{"-n", "-15", exeOxmPlayer}
n_args = append(n_args, args...)
cmd = exec.Command("nice", n_args...)
err = cmd.Start()
return
}

0 comments on commit 0c0cf13

Please sign in to comment.