playlist: move checks out of playlist_sync_with_queue()
Rename the function to playlist_song_started(), which gets only called if the song has actually started.
This commit is contained in:
parent
7f80349494
commit
cff727644d
@ -93,13 +93,14 @@ playlist_queue_song_order(struct playlist *playlist, unsigned order)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the player thread has already started playing the "queued"
|
* Called if the player thread has started playing the "queued" song.
|
||||||
* song.
|
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
playlist_sync_with_queue(struct playlist *playlist)
|
playlist_song_started(struct playlist *playlist)
|
||||||
{
|
{
|
||||||
if (pc.next_song == NULL && playlist->queued != -1) {
|
assert(pc.next_song == NULL);
|
||||||
|
assert(playlist->queued >= -1);
|
||||||
|
|
||||||
/* queued song has started: copy queued to current,
|
/* queued song has started: copy queued to current,
|
||||||
and notify the clients */
|
and notify the clients */
|
||||||
|
|
||||||
@ -120,7 +121,6 @@ playlist_sync_with_queue(struct playlist *playlist)
|
|||||||
|
|
||||||
idle_add(IDLE_PLAYER);
|
idle_add(IDLE_PLAYER);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const struct song *
|
const struct song *
|
||||||
playlist_get_queued_song(struct playlist *playlist)
|
playlist_get_queued_song(struct playlist *playlist)
|
||||||
@ -228,7 +228,8 @@ playlist_sync(struct playlist *playlist)
|
|||||||
else {
|
else {
|
||||||
/* check if the player thread has already started
|
/* check if the player thread has already started
|
||||||
playing the queued song */
|
playing the queued song */
|
||||||
playlist_sync_with_queue(playlist);
|
if (pc.next_song == NULL && playlist->queued != -1)
|
||||||
|
playlist_song_started(playlist);
|
||||||
|
|
||||||
/* make sure the queued song is always set (if
|
/* make sure the queued song is always set (if
|
||||||
possible) */
|
possible) */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user