aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:44:34 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:44:34 +0200
commitb616dff77d8e0d7a930327007690444a356dcbf3 (patch)
tree9fd5b40b89e66ed4ddd3d5f4fc6f94e6bd7f59eb /src/playlist.c
parentbf4af19f54d53d23023177222a79ee83b9fde87a (diff)
downloadmpd-b616dff77d8e0d7a930327007690444a356dcbf3.tar.gz
mpd-b616dff77d8e0d7a930327007690444a356dcbf3.tar.xz
mpd-b616dff77d8e0d7a930327007690444a356dcbf3.zip
no commandError() in playerSeek()
We should avoid having protocol specific code in player.c. Just return success or failure, and let the caller send the error code to the MPD client.
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 8ffd56684..4560b85a5 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1354,7 +1354,7 @@ int getPlaylistLength(void)
int seekSongInPlaylist(int fd, int song, float seek_time)
{
- int i;
+ int i, ret;
if (song < 0 || song >= playlist.length) {
commandError(fd, ACK_ERROR_NO_EXIST,
@@ -1381,7 +1381,11 @@ int seekSongInPlaylist(int fd, int song, float seek_time)
playPlaylistOrderNumber(i);
}
- return playerSeek(fd, playlist.songs[playlist.order[i]], seek_time);
+ ret = playerSeek(playlist.songs[playlist.order[i]], seek_time);
+ if (ret < 0)
+ commandError(fd, ACK_ERROR_PLAYER_SYNC,
+ "player not currently playing");
+ return ret;
}
int seekSongInPlaylistById(int fd, int id, float seek_time)