aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:27:16 +0200
commit3db333b5a46f8d147043afc4d400d18851d3606d (patch)
tree882c370396bc53b035c14a6bf3032fdcc98b8e0e /src/playlist.c
parent6df980a996192fc459a0b60b73fa7a33a24a2f49 (diff)
downloadmpd-3db333b5a46f8d147043afc4d400d18851d3606d.tar.gz
mpd-3db333b5a46f8d147043afc4d400d18851d3606d.tar.xz
mpd-3db333b5a46f8d147043afc4d400d18851d3606d.zip
player: no "fd" and no return value
Most player*() functions do not actually use the file descriptor, and always return 0 (success). Eliminate them to get a leaner interface.
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/playlist.c b/src/playlist.c
index f878de643..bb706002f 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -286,7 +286,7 @@ static void loadPlaylistFromStateFile(FILE *fp, char *buffer,
playlist.length - 1, 0);
}
if (state == PLAYER_STATE_PAUSE) {
- playerPause(STDERR_FILENO);
+ playerPause();
}
if (state != PLAYER_STATE_STOP) {
seekSongInPlaylist(STDERR_FILENO,
@@ -790,7 +790,7 @@ int deleteFromPlaylist(int fd, int song)
&& playlist.current == songOrder) {
/*if(playlist.current>=playlist.length) return playerStop(fd);
else return playPlaylistOrderNumber(fd,playlist.current); */
- playerWait(STDERR_FILENO);
+ playerWait();
playlist_noGoToNext = 1;
}
@@ -828,11 +828,10 @@ void deleteASongFromPlaylist(Song * song)
}
}
-int stopPlaylist(int fd)
+int stopPlaylist(mpd_unused int fd)
{
DEBUG("playlist: stop\n");
- if (playerWait(fd) < 0)
- return -1;
+ playerWait();
playlist.queued = -1;
playlist_state = PLAYLIST_STATE_STOP;
playlist_noGoToNext = 0;
@@ -841,12 +840,11 @@ int stopPlaylist(int fd)
return 0;
}
-static int playPlaylistOrderNumber(int fd, int orderNum)
+static int playPlaylistOrderNumber(mpd_unused int fd, int orderNum)
{
char path_max_tmp[MPD_PATH_MAX];
- if (playerStop(fd) < 0)
- return -1;
+ playerStop();
playlist_state = PLAYLIST_STATE_PLAY;
playlist_noGoToNext = 0;
@@ -857,11 +855,7 @@ static int playPlaylistOrderNumber(int fd, int orderNum)
get_song_url(path_max_tmp,
playlist.songs[playlist.order[orderNum]]));
- if (playerPlay(fd, (playlist.songs[playlist.order[orderNum]])) < 0) {
- stopPlaylist(fd);
- return -1;
- }
-
+ playerPlay(playlist.songs[playlist.order[orderNum]]);
playlist.current = orderNum;
return 0;
@@ -878,7 +872,8 @@ int playPlaylist(int fd, int song, int stopOnError)
return 0;
if (playlist_state == PLAYLIST_STATE_PLAY) {
- return playerSetPause(fd, 0);
+ playerSetPause(0);
+ return 0;
}
if (playlist.current >= 0 && playlist.current < playlist.length) {
i = playlist.current;