Jukebox cleanup (#2554)

* Fixing typo FFmpegPath -> MPVPath

* Fixing panic by applying afontenot patch

* Using mpv audio-device flag and naming for config and playback
This commit is contained in:
Matthias Schmidt
2023-10-18 00:12:48 +02:00
committed by GitHub
parent 2cd4358172
commit 59f0c487e7
4 changed files with 45 additions and 21 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ type MpvTrack struct {
CloseCalled bool
}
func NewTrack(playbackDoneChannel chan bool, mf model.MediaFile) (*MpvTrack, error) {
func NewTrack(playbackDoneChannel chan bool, deviceName string, mf model.MediaFile) (*MpvTrack, error) {
log.Debug("loading track", "trackname", mf.Path, "mediatype", mf.ContentType())
if _, err := mpvCommand(); err != nil {
@@ -33,7 +33,7 @@ func NewTrack(playbackDoneChannel chan bool, mf model.MediaFile) (*MpvTrack, err
tmpSocketName := TempFileName("mpv-ctrl-", ".socket")
args := createMPVCommand(mpvComdTemplate, mf.Path, tmpSocketName)
args := createMPVCommand(mpvComdTemplate, deviceName, mf.Path, tmpSocketName)
exe, err := start(args)
if err != nil {
log.Error("error starting mpv process", "error", err)