Support clear-first in cue play command

This commit is contained in:
Julien BLACHE 2010-10-31 11:52:31 +01:00
parent 0df4ab4555
commit 5674314161

View File

@ -727,10 +727,25 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u
const char *cuequery; const char *cuequery;
const char *param; const char *param;
uint32_t id; uint32_t id;
int clear;
int ret; int ret;
/* /cue?command=play&query=...&sort=...&index=N */ /* /cue?command=play&query=...&sort=...&index=N */
param = evhttp_find_header(query, "clear-first");
if (param)
{
ret = safe_atoi32(param, &clear);
if (ret < 0)
DPRINTF(E_LOG, L_DACP, "Invalid clear-first value in cue request\n");
else if (clear)
{
player_playback_stop();
player_queue_clear();
}
}
cuequery = evhttp_find_header(query, "query"); cuequery = evhttp_find_header(query, "query");
if (cuequery) if (cuequery)
{ {