mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 16:25:03 -05:00
[player] Check player state in stop and pause commands
This commit is contained in:
parent
4274653624
commit
183ac17fd5
18
src/player.c
18
src/player.c
@ -1890,6 +1890,12 @@ playback_stop(void *arg, int *retval)
|
||||
{
|
||||
struct player_source *ps_playing;
|
||||
|
||||
if (player_state == PLAY_STOPPED)
|
||||
{
|
||||
*retval = 0;
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
// We may be restarting very soon, so we don't bring the devices to a full
|
||||
// stop just yet; this saves time when restarting, which is nicer for the user
|
||||
*retval = outputs_flush(device_command_cb, last_rtptime + AIRTUNES_V2_PACKET_SAMPLES);
|
||||
@ -2335,6 +2341,18 @@ playback_pause(void *arg, int *retval)
|
||||
{
|
||||
uint64_t pos;
|
||||
|
||||
if (player_state == PLAY_STOPPED)
|
||||
{
|
||||
*retval = -1;
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
if (player_state == PLAY_PAUSED)
|
||||
{
|
||||
*retval = 0;
|
||||
return COMMAND_END;
|
||||
}
|
||||
|
||||
pos = source_check();
|
||||
if (pos == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user