From b4a5ba6f3c8ac7569baf6720c1bca858716aca4b Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 24 Apr 2010 17:26:33 +0200 Subject: [PATCH] Wire up pause and playpause --- src/httpd_dacp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 15d01946..c6d5d45d 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -423,7 +423,7 @@ dacp_reply_pause(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, if (!s) return; - /* TODO */ + player_playback_pause(); /* 204 No Content is the canonical reply */ evhttp_send_reply(req, HTTP_NOCONTENT, "No Content", evbuf); @@ -433,12 +433,20 @@ static void dacp_reply_playpause(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query) { struct daap_session *s; + int ret; s = daap_session_find(req, query, evbuf); if (!s) return; - /* TODO */ + ret = player_playback_start(NULL); + if (ret < 0) + { + DPRINTF(E_LOG, L_DACP, "Player returned an error for start after pause\n"); + + evhttp_send_error(req, 500, "Internal Server Error"); + return; + } /* 204 No Content is the canonical reply */ evhttp_send_reply(req, HTTP_NOCONTENT, "No Content", evbuf);