respect coding convention and changed log level

This commit is contained in:
chme 2014-04-20 06:43:01 +02:00
parent 32c3b57fcd
commit 01cc83f819
2 changed files with 19 additions and 17 deletions

View File

@ -1439,14 +1439,14 @@ dacp_reply_playqueueedit_move(struct evhttp_request *req, struct evbuffer *evbuf
*/ */
int ret; int ret;
const char *editparams; const char *param;
int src; int src;
int dst; int dst;
editparams = evhttp_find_header(query, "edit-params"); param = evhttp_find_header(query, "edit-params");
if (editparams) if (param)
{ {
ret = safe_atoi32(strchr(editparams, ':') + 1, &src); ret = safe_atoi32(strchr(param, ':') + 1, &src);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-from value in playqueue-edit request\n"); DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-from value in playqueue-edit request\n");
@ -1455,7 +1455,7 @@ dacp_reply_playqueueedit_move(struct evhttp_request *req, struct evbuffer *evbuf
return; return;
} }
ret = safe_atoi32(strchr(editparams, ',') + 1, &dst); ret = safe_atoi32(strchr(param, ',') + 1, &dst);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-to value in playqueue-edit request\n"); DPRINTF(E_LOG, L_DACP, "Invalid edit-params move-to value in playqueue-edit request\n");
@ -1481,13 +1481,13 @@ dacp_reply_playqueueedit_remove(struct evhttp_request *req, struct evbuffer *evb
*/ */
int ret; int ret;
const char *itemsparam; const char *param;
int item_index; int item_index;
itemsparam = evhttp_find_header(query, "items"); param = evhttp_find_header(query, "items");
if (itemsparam) if (param)
{ {
ret = safe_atoi32(itemsparam, &item_index); ret = safe_atoi32(param, &item_index);
if (ret < 0) if (ret < 0)
{ {
DPRINTF(E_LOG, L_DACP, "Invalid edit-params remove item value in playqueue-edit request\n"); DPRINTF(E_LOG, L_DACP, "Invalid edit-params remove item value in playqueue-edit request\n");

View File

@ -3398,22 +3398,24 @@ queue_add_next(struct player_command *cmd)
static int static int
queue_move(struct player_command *cmd) queue_move(struct player_command *cmd)
{ {
struct player_source *ps_src = NULL; struct player_source *ps_src;
struct player_source *ps_dst = NULL; struct player_source *ps_dst;
int i;
int pos_max = MAX(cmd->arg.ps_pos[0], cmd->arg.ps_pos[1]); int pos_max = MAX(cmd->arg.ps_pos[0], cmd->arg.ps_pos[1]);
DPRINTF(E_LOG, L_PLAYER, "Move song from position %d to be next song after %d\n", cmd->arg.ps_pos[0], DPRINTF(E_DBG, L_PLAYER, "Move song from position %d to be next song after %d\n", cmd->arg.ps_pos[0],
cmd->arg.ps_pos[1]); cmd->arg.ps_pos[1]);
struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming; struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming;
if (!ps_tmp) if (!ps_tmp)
{ {
DPRINTF(E_DBG, L_PLAYER, "Current playing/streaming song not found\n"); DPRINTF(E_LOG, L_PLAYER, "Current playing/streaming song not found\n");
return 0; return 0;
} }
int i = 0; ps_src = NULL;
for (i = 0; i <= pos_max; ++i) ps_dst = NULL;
for (i = 0; i <= pos_max; i++)
{ {
if (i == cmd->arg.ps_pos[0]) if (i == cmd->arg.ps_pos[0])
ps_src = ps_tmp; ps_src = ps_tmp;
@ -3465,12 +3467,12 @@ queue_remove(struct player_command *cmd)
{ {
struct player_source *ps_src = NULL; struct player_source *ps_src = NULL;
DPRINTF(E_LOG, L_PLAYER, "Remove song from position %d\n", cmd->arg.ps_pos[0]); DPRINTF(E_DBG, L_PLAYER, "Remove song from position %d\n", cmd->arg.ps_pos[0]);
struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming; struct player_source *ps_tmp = cur_playing ? cur_playing : cur_streaming;
if (!ps_tmp) if (!ps_tmp)
{ {
DPRINTF(E_DBG, L_PLAYER, "Current playing/streaming song not found\n"); DPRINTF(E_LOG, L_PLAYER, "Current playing/streaming song not found\n");
return 0; return 0;
} }