command: don't restart player in the "status" command
Don't attempt to restart the player if it was stopped, but there were still songs left on the playlist. This looks like it has been a workaround for a bug which has been fixed long time ago.
This commit is contained in:
@@ -451,7 +451,6 @@ handle_status(struct client *client,
|
|||||||
int updateJobId;
|
int updateJobId;
|
||||||
int song;
|
int song;
|
||||||
|
|
||||||
playPlaylistIfPlayerStopped();
|
|
||||||
switch (getPlayerState()) {
|
switch (getPlayerState()) {
|
||||||
case PLAYER_STATE_STOP:
|
case PLAYER_STATE_STOP:
|
||||||
state = "stop";
|
state = "stop";
|
||||||
|
@@ -861,6 +861,8 @@ enum playlist_result playPlaylistById(int id, int stopOnError)
|
|||||||
return playPlaylist(song, stopOnError);
|
return playPlaylist(song, stopOnError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void playPlaylistIfPlayerStopped(void);
|
||||||
|
|
||||||
void syncPlayerAndPlaylist(void)
|
void syncPlayerAndPlaylist(void)
|
||||||
{
|
{
|
||||||
if (playlist_state != PLAYLIST_STATE_PLAY)
|
if (playlist_state != PLAYLIST_STATE_PLAY)
|
||||||
@@ -911,7 +913,7 @@ void nextSongInPlaylist(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void playPlaylistIfPlayerStopped(void)
|
static void playPlaylistIfPlayerStopped(void)
|
||||||
{
|
{
|
||||||
if (getPlayerState() == PLAYER_STATE_STOP) {
|
if (getPlayerState() == PLAYER_STATE_STOP) {
|
||||||
enum player_error error = getPlayerError();
|
enum player_error error = getPlayerError();
|
||||||
|
@@ -149,8 +149,6 @@ int getPlaylistLength(void);
|
|||||||
|
|
||||||
unsigned long getPlaylistVersion(void);
|
unsigned long getPlaylistVersion(void);
|
||||||
|
|
||||||
void playPlaylistIfPlayerStopped(void);
|
|
||||||
|
|
||||||
enum playlist_result seekSongInPlaylist(unsigned song, float seek_time);
|
enum playlist_result seekSongInPlaylist(unsigned song, float seek_time);
|
||||||
|
|
||||||
enum playlist_result seekSongInPlaylistById(unsigned id, float seek_time);
|
enum playlist_result seekSongInPlaylistById(unsigned id, float seek_time);
|
||||||
|
Reference in New Issue
Block a user