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:
parent
7125fdc4f2
commit
110cef6fda
11
src/player.c
11
src/player.c
@ -52,14 +52,6 @@ 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);
|
||||||
|
|
||||||
@ -67,6 +59,9 @@ void playerStop(void)
|
|||||||
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);
|
|||||||
|
|
||||||
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)
|
|||||||
{
|
{
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user