mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 21:49:48 -05:00
[player] Add config option to disable clearing the queue after playback
stops (default is clearing the queue) and if true do not clear the queue. This option is necessary because some dacp clients rely on the queue being empty if player is stopped. Retune for example does not always show the queue contents if player state is stopped.
This commit is contained in:
@@ -139,6 +139,7 @@ static cfg_opt_t sec_mpd[] =
|
||||
{
|
||||
CFG_INT("port", 6600, CFGF_NONE),
|
||||
CFG_INT("http_port", 0, CFGF_NONE),
|
||||
CFG_BOOL("clear_queue_on_stop_disable", cfg_false, CFGF_NONE),
|
||||
CFG_END()
|
||||
};
|
||||
|
||||
|
||||
10
src/player.c
10
src/player.c
@@ -244,6 +244,9 @@ static struct event *exitev;
|
||||
static struct event *cmdev;
|
||||
static pthread_t tid_player;
|
||||
|
||||
/* Config values */
|
||||
static int clear_queue_on_stop_disabled;
|
||||
|
||||
/* Player status */
|
||||
static enum play_status player_state;
|
||||
static enum repeat_mode repeat;
|
||||
@@ -2167,10 +2170,11 @@ playback_abort(void)
|
||||
|
||||
source_stop();
|
||||
|
||||
playerqueue_clear(NULL);
|
||||
|
||||
evbuffer_drain(audio_buf, evbuffer_get_length(audio_buf));
|
||||
|
||||
if (!clear_queue_on_stop_disabled)
|
||||
playerqueue_clear(NULL);
|
||||
|
||||
status_update(PLAY_STOPPED);
|
||||
|
||||
metadata_purge();
|
||||
@@ -4590,6 +4594,8 @@ player_init(void)
|
||||
|
||||
player_exit = 0;
|
||||
|
||||
clear_queue_on_stop_disabled = cfg_getbool(cfg_getsec(cfg, "mpd"), "clear_queue_on_stop_disable");
|
||||
|
||||
dev_autoselect = 1;
|
||||
dev_list = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user