Fixes two issues with Hyperfine Remote for Android

1. H. Remote uses the playpause command to both play and pause,
but forked-daapd would only support play, not pause.
2. H. Remote sends speaker id's in decimal, not in hex like other
remotes. Fixed so forked-daapd will understand both.
This commit is contained in:
ejurgensen 2013-08-30 21:50:31 +02:00
parent 799fe9e684
commit 83edef0f01

View File

@ -967,12 +967,21 @@ static void
dacp_reply_playpause(struct evhttp_request *req, struct evbuffer *evbuf, char **uri, struct evkeyvalq *query)
{
struct daap_session *s;
struct player_status status;
int ret;
s = daap_session_find(req, query, evbuf);
if (!s)
return;
player_get_status(&status);
if (status.status == PLAY_PLAYING)
{
player_playback_pause();
}
else
{
ret = player_playback_start(NULL);
if (ret < 0)
{
@ -981,6 +990,7 @@ dacp_reply_playpause(struct evhttp_request *req, struct evbuffer *evbuf, char **
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);
@ -1502,6 +1512,9 @@ dacp_reply_setspeakers(struct evhttp_request *req, struct evbuffer *evbuf, char
do
{
param++;
/* Hyperfine Remote for Android will send in decimal, others use hex */
if (safe_atou64(param, &ids[i]) < 0)
{
ret = safe_hextou64(param, &ids[i]);
if (ret < 0)
{
@ -1510,7 +1523,7 @@ dacp_reply_setspeakers(struct evhttp_request *req, struct evbuffer *evbuf, char
nspk--;
continue;
}
}
i++;
}
while ((param = strchr(param + 1, ',')));