queue/PlaylistControl: keep order list consistency in MoveOrderToCurrent()

Our previous use of Queue::SwapOrders() could cause surprising
results:

- sometimes, the old "current" song would be played again (if the
  newly selected song had not been played already)

- sometimes, the old "current" song would not be played again (if the
  newly selected song had already been played)

This is inconsistent, because it should not depend on whether the
newly selected song had already been played.

So instead of Queue::SwapOrders() we now use Queue::MoveOrderAfter()
and Queue::MoveOrderBefore(), which is more expensive, but also more
consistent.  It attempts to retain as much from the previous order
list as possible, and only moves the newly selected song around.
This commit is contained in:
Max Kellermann
2017-10-17 19:44:16 +02:00
parent 0f79287b04
commit 91254e9211
2 changed files with 16 additions and 9 deletions

1
NEWS
View File

@@ -4,6 +4,7 @@ ver 0.20.11 (not yet released)
* decoder
- ffmpeg: more reliable song duration
- gme: fix track numbering
* improve random song order when switching songs manually
* fix case insensitive search without libicu
* fix endless loop when accessing malformed file names in ZIP files