diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 16:53:37 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-06-30 18:09:46 +0200 |
| commit | 49b0b8d27c2a37e4869857542b4750fc61771d95 (patch) | |
| tree | 6884b88d3733c72a0b097489dc3eb1d23e379066 /wrms.go | |
| parent | 5d7a7c837732519c7013cccc7819d92f321a284c (diff) | |
| download | WRMS-49b0b8d27c2a37e4869857542b4750fc61771d95.tar.gz WRMS-49b0b8d27c2a37e4869857542b4750fc61771d95.zip | |
serialize player state change though a channel
Only the player.serveCmds and the runMpv goroutines are racing now.
But this race should be a benign race.
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -155,7 +155,7 @@ type Wrms struct { Songs []Song queue Playlist CurrentSong atomic.Pointer[Song] - Player Player + Player *Player Playing bool Config Config eventId atomic.Uint64 @@ -357,7 +357,7 @@ func (wrms *Wrms) PlayPause() { } // Wrms has an active mpv process -> continue playing - if wrms.Player.mpv != nil { + if wrms.Player.mpv.Load() != nil { wrms.Player.Continue() // Wrms has a current song but no mpv process playing it -> start a new one } else { |
