diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 18:06:08 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 18:09:46 +0200 |
| commit | 6173e6227f4af0ce43baab074070a2d5df2c8a98 (patch) | |
| tree | 1a8dc4a693a24338580aa8b1feee6657499cf4de | |
| parent | 1da552c5e9c0a110056537647b325e1107d8a6bb (diff) | |
| download | WRMS-6173e6227f4af0ce43baab074070a2d5df2c8a98.tar.gz WRMS-6173e6227f4af0ce43baab074070a2d5df2c8a98.zip | |
remember the current song before waiting for mpv
| -rw-r--r-- | player.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -89,6 +89,10 @@ func (player *Player) startMpv(uri string) *exec.Cmd { } func (player *Player) runMpv() { + // Remember the song we are playing + // TODO: This is potentially racy + currentSong := wrms.CurrentSong.Load() + mpv := player.mpv.Load() output, err := mpv.CombinedOutput() if err != nil { @@ -99,7 +103,6 @@ func (player *Player) runMpv() { } } - currentSong := wrms.CurrentSong.Load() player.mpv.Store(nil) player.Backends[currentSong.Source].OnSongFinished(currentSong) |
