From 5674314161a4f88153a4a65e8bd1e856b46a1472 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sun, 31 Oct 2010 11:52:31 +0100 Subject: [PATCH] Support clear-first in cue play command --- src/httpd_dacp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index a280d972..201793ee 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -727,10 +727,25 @@ dacp_reply_cue_play(struct evhttp_request *req, struct evbuffer *evbuf, char **u const char *cuequery; const char *param; uint32_t id; + int clear; int ret; /* /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"); if (cuequery) {