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.
This commit is contained in:
Max Kellermann 2008-08-26 08:27:17 +02:00
parent 7125fdc4f2
commit 110cef6fda
3 changed files with 3 additions and 12 deletions

View File

@ -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)

View File

@ -109,8 +109,6 @@ void playerSetPause(int pause_flag);
void playerPause(void);
void playerStop(void);
void playerKill(void);
int getPlayerTotalTime(void);

View File

@ -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;