diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/queue/PlaylistEdit.cxx | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,6 @@ ver 0.21.25 (not yet released) +* protocol: + - fix crash when using "rangeid" while playing ver 0.21.24 (2020/06/10) * protocol diff --git a/src/queue/PlaylistEdit.cxx b/src/queue/PlaylistEdit.cxx index 9a2b37eed..8655e0894 100644 --- a/src/queue/PlaylistEdit.cxx +++ b/src/queue/PlaylistEdit.cxx @@ -431,6 +431,8 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, if (position < 0) throw PlaylistError::NoSuchSong(); + bool was_queued = false; + if (playing) { if (position == current) throw PlaylistError(PlaylistResult::DENIED, @@ -442,6 +444,10 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, already; cancel that */ pc.LockCancel(); queued = -1; + + /* schedule a call to UpdateQueuedSong() to + re-queue the song with its new range */ + was_queued = true; } } @@ -464,7 +470,8 @@ playlist::SetSongIdRange(PlayerControl &pc, unsigned id, song.SetEndTime(end); /* announce the change to all interested subsystems */ - UpdateQueuedSong(pc, nullptr); + if (was_queued) + UpdateQueuedSong(pc, nullptr); queue.ModifyAtPosition(position); OnModified(); } |