Commit 110cef6f authored by Max Kellermann's avatar Max Kellermann

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.
parent 7125fdc4
...@@ -53,20 +53,15 @@ void player_command_finished() ...@@ -53,20 +53,15 @@ void player_command_finished()
void playerPlay(Song * song) void playerPlay(Song * song)
{ {
playerStop();
set_current_song(song);
player_command(PLAYER_COMMAND_PLAY);
}
void playerStop(void)
{
assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED); assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED);
if (pc.state != PLAYER_STATE_STOP) if (pc.state != PLAYER_STATE_STOP)
player_command(PLAYER_COMMAND_STOP); player_command(PLAYER_COMMAND_STOP);
pc.queueState = PLAYER_QUEUE_BLANK; pc.queueState = PLAYER_QUEUE_BLANK;
set_current_song(song);
player_command(PLAYER_COMMAND_PLAY);
} }
void playerWait(void) void playerWait(void)
......
...@@ -109,8 +109,6 @@ void playerSetPause(int pause_flag); ...@@ -109,8 +109,6 @@ void playerSetPause(int pause_flag);
void playerPause(void); void playerPause(void);
void playerStop(void);
void playerKill(void); void playerKill(void);
int getPlayerTotalTime(void); int getPlayerTotalTime(void);
......
...@@ -837,8 +837,6 @@ static void playPlaylistOrderNumber(int orderNum) ...@@ -837,8 +837,6 @@ static void playPlaylistOrderNumber(int orderNum)
{ {
char path_max_tmp[MPD_PATH_MAX]; char path_max_tmp[MPD_PATH_MAX];
playerStop();
playlist_state = PLAYLIST_STATE_PLAY; playlist_state = PLAYLIST_STATE_PLAY;
playlist_noGoToNext = 0; playlist_noGoToNext = 0;
playlist.queued = -1; playlist.queued = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment