PlaylistEdit: don't interrupt playback when current song gets deleted
This commit is contained in:
parent
ce18c36ed9
commit
3a4e667078
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ ver 0.18.10 (not yet released)
|
||||||
- ffmpeg: fix seeking bug
|
- ffmpeg: fix seeking bug
|
||||||
- ffmpeg: handle unknown stream start time
|
- ffmpeg: handle unknown stream start time
|
||||||
- gme: fix memory leak
|
- gme: fix memory leak
|
||||||
|
* don't interrupt playback when current song gets deleted
|
||||||
|
|
||||||
ver 0.18.9 (2014/03/02)
|
ver 0.18.9 (2014/03/02)
|
||||||
* protocol
|
* protocol
|
||||||
|
|
|
@ -234,12 +234,8 @@ playlist::DeleteInternal(PlayerControl &pc,
|
||||||
if (playing && current == (int)songOrder) {
|
if (playing && current == (int)songOrder) {
|
||||||
const bool paused = pc.GetState() == PlayerState::PAUSE;
|
const bool paused = pc.GetState() == PlayerState::PAUSE;
|
||||||
|
|
||||||
/* the current song is going to be deleted: stop the player */
|
/* the current song is going to be deleted: see which
|
||||||
|
song is going to be played instead */
|
||||||
pc.Stop();
|
|
||||||
playing = false;
|
|
||||||
|
|
||||||
/* see which song is going to be played instead */
|
|
||||||
|
|
||||||
current = queue.GetNextOrder(current);
|
current = queue.GetNextOrder(current);
|
||||||
if (current == (int)songOrder)
|
if (current == (int)songOrder)
|
||||||
|
@ -248,10 +244,12 @@ playlist::DeleteInternal(PlayerControl &pc,
|
||||||
if (current >= 0 && !paused)
|
if (current >= 0 && !paused)
|
||||||
/* play the song after the deleted one */
|
/* play the song after the deleted one */
|
||||||
PlayOrder(pc, current);
|
PlayOrder(pc, current);
|
||||||
else
|
else {
|
||||||
/* no songs left to play, stop playback
|
/* stop the player */
|
||||||
completely */
|
|
||||||
Stop(pc);
|
pc.Stop();
|
||||||
|
playing = false;
|
||||||
|
}
|
||||||
|
|
||||||
*queued_p = nullptr;
|
*queued_p = nullptr;
|
||||||
} else if (current == (int)songOrder)
|
} else if (current == (int)songOrder)
|
||||||
|
|
Loading…
Reference in New Issue