aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-24 13:20:07 +0100
committerMax Kellermann <max@duempel.org>2009-01-24 13:20:07 +0100
commitae2d13ac3e480a03d20a7158ee7492059f27ed52 (patch)
tree39e297375a21d7d97e7a8ff4b76f4092adc8d68b /src/playlist.c
parent82df4cb2b0dfdb58e7b459bcf5cf2a286c8c640a (diff)
downloadmpd-ae2d13ac3e480a03d20a7158ee7492059f27ed52.tar.gz
mpd-ae2d13ac3e480a03d20a7158ee7492059f27ed52.tar.xz
mpd-ae2d13ac3e480a03d20a7158ee7492059f27ed52.zip
playlist: moved stopOnError and errorCount into struct playlist
Moved the 2 remaining global variables into the playlist struct.
Diffstat (limited to '')
-rw-r--r--src/playlist.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/playlist.c b/src/playlist.c
index f6e3d6e2f..1376c8098 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -75,8 +75,6 @@ static GRand *g_rand;
/** the global playlist object */
static Playlist playlist;
unsigned playlist_max_length;
-static int playlist_stopOnError;
-static unsigned playlist_errorCount;
bool playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS;
@@ -743,8 +741,8 @@ enum playlist_result playPlaylist(int song)
i = playlist.current;
}
- playlist_stopOnError = false;
- playlist_errorCount = 0;
+ playlist.stop_on_error = false;
+ playlist.error_count = 0;
playPlaylistOrderNumber(i);
return PLAYLIST_RESULT_SUCCESS;
@@ -808,7 +806,7 @@ void nextSongInPlaylist(void)
syncPlaylistWithQueue();
- playlist_stopOnError = 0;
+ playlist.stop_on_error = false;
/* determine the next song from the queue's order list */
@@ -849,13 +847,13 @@ static void playPlaylistIfPlayerStopped(void)
error = getPlayerError();
if (error == PLAYER_ERROR_NOERROR)
- playlist_errorCount = 0;
+ playlist.error_count = 0;
else
- playlist_errorCount++;
+ ++playlist.error_count;
- if ((playlist_stopOnError && error != PLAYER_ERROR_NOERROR) ||
+ if ((playlist.stop_on_error && error != PLAYER_ERROR_NOERROR) ||
error == PLAYER_ERROR_AUDIO || error == PLAYER_ERROR_SYSTEM ||
- playlist_errorCount >= queue_length(&playlist.queue))
+ playlist.error_count >= queue_length(&playlist.queue))
/* too many errors, or critical error: stop
playback */
stopPlaylist();
@@ -1157,8 +1155,8 @@ enum playlist_result seekSongInPlaylist(unsigned song, float seek_time)
i = song;
clearPlayerError();
- playlist_stopOnError = 1;
- playlist_errorCount = 0;
+ playlist.stop_on_error = true;
+ playlist.error_count = 0;
if (playlist.playing) {
if (playlist.queued >= 0)