From 110cef6fda704ae9ea806c13ef346de6a1059a9f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:17 +0200 Subject: don't call playerStop() before playerPlay() Since playerPlay() already calls playerStop(), we can remove its invocation of playerStop() from playPlaylistOrderNumber(). We can also make playerStop a static function. --- src/player.c | 11 +++-------- src/player.h | 2 -- src/playlist.c | 2 -- 3 files changed, 3 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/player.c b/src/player.c index 6a2c3a08e..4de92fb8e 100644 --- a/src/player.c +++ b/src/player.c @@ -52,14 +52,6 @@ void player_command_finished() } void playerPlay(Song * song) -{ - playerStop(); - - set_current_song(song); - player_command(PLAYER_COMMAND_PLAY); -} - -void playerStop(void) { assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED); @@ -67,6 +59,9 @@ void playerStop(void) player_command(PLAYER_COMMAND_STOP); pc.queueState = PLAYER_QUEUE_BLANK; + + set_current_song(song); + player_command(PLAYER_COMMAND_PLAY); } void playerWait(void) diff --git a/src/player.h b/src/player.h index de237c4ba..a4db82dc2 100644 --- a/src/player.h +++ b/src/player.h @@ -109,8 +109,6 @@ void playerSetPause(int pause_flag); void playerPause(void); -void playerStop(void); - void playerKill(void); int getPlayerTotalTime(void); diff --git a/src/playlist.c b/src/playlist.c index 0f6f1d010..e5aad2ed8 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -837,8 +837,6 @@ static void playPlaylistOrderNumber(int orderNum) { char path_max_tmp[MPD_PATH_MAX]; - playerStop(); - playlist_state = PLAYLIST_STATE_PLAY; playlist_noGoToNext = 0; playlist.queued = -1; -- cgit v1.2.3