aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:18 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:18 +0200
commit7d3429a6d89634f098770f7dce8442f59aac9890 (patch)
treea194ee5d1fb3d1f3e7318ceb991be30e54958a8d
parenta9f0d85115643b61fd8380b8c21e456feed57e17 (diff)
downloadmpd-7d3429a6d89634f098770f7dce8442f59aac9890.tar.gz
mpd-7d3429a6d89634f098770f7dce8442f59aac9890.tar.xz
mpd-7d3429a6d89634f098770f7dce8442f59aac9890.zip
removed the "queue" parameter from syncPlaylistWithQueue()
There is only one caller which passes "true", so we can move the queueNextSongInPlaylist() invocation there.
-rw-r--r--src/playlist.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 623d122ba..31180e4e7 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -505,7 +505,7 @@ static void queueNextSongInPlaylist(void)
}
}
-static void syncPlaylistWithQueue(int queue)
+static void syncPlaylistWithQueue(void)
{
switch (getPlayerQueueState()) {
case PLAYER_QUEUE_EMPTY:
@@ -515,11 +515,6 @@ static void syncPlaylistWithQueue(int queue)
playlist.current = playlist.queued;
}
playlist.queued = -1;
- /* intentionally no break here */
-
- case PLAYER_QUEUE_BLANK:
- if (queue)
- queueNextSongInPlaylist();
break;
case PLAYER_QUEUE_DECODE:
@@ -532,6 +527,7 @@ static void syncPlaylistWithQueue(int queue)
case PLAYER_QUEUE_FULL:
case PLAYER_QUEUE_PLAY:
case PLAYER_QUEUE_STOP:
+ case PLAYER_QUEUE_BLANK:
break;
}
}
@@ -541,7 +537,7 @@ static void clearPlayerQueue(void)
if (getPlayerQueueState() == PLAYER_QUEUE_PLAY ||
getPlayerQueueState() == PLAYER_QUEUE_FULL) {
playerQueueLock();
- syncPlaylistWithQueue(0);
+ syncPlaylistWithQueue();
}
playlist.queued = -1;
@@ -937,8 +933,11 @@ void syncPlayerAndPlaylist(void)
if (getPlayerState() == PLAYER_STATE_STOP)
playPlaylistIfPlayerStopped();
- else
- syncPlaylistWithQueue(1);
+ else {
+ syncPlaylistWithQueue();
+ if (getPlayerQueueState() == PLAYER_QUEUE_BLANK)
+ queueNextSongInPlaylist();
+ }
syncCurrentPlayerDecodeMetadata();
}
@@ -950,7 +949,7 @@ static void currentSongInPlaylist(void)
playlist_stopOnError = 0;
- syncPlaylistWithQueue(0);
+ syncPlaylistWithQueue();
if (playlist.current >= 0 && playlist.current < playlist.length)
playPlaylistOrderNumber(playlist.current);
@@ -963,7 +962,7 @@ void nextSongInPlaylist(void)
if (playlist_state != PLAYLIST_STATE_PLAY)
return;
- syncPlaylistWithQueue(0);
+ syncPlaylistWithQueue();
playlist_stopOnError = 0;
@@ -1223,7 +1222,7 @@ void previousSongInPlaylist(void)
if (playlist_state != PLAYLIST_STATE_PLAY)
return;
- syncPlaylistWithQueue(0);
+ syncPlaylistWithQueue();
if (diff && getPlayerElapsedTime() > PLAYLIST_PREV_UNLESS_ELAPSED) {
playPlaylistOrderNumber(playlist.current);