From 305c1a141c6acb3e97dea6cefe7475e926d8953c Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 4 May 2014 22:36:37 +0200 Subject: [PATCH] Indentation --- src/httpd_dacp.c | 87 ++++++++++++++++++++++++------------------------ src/player.c | 18 +++++----- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 9291d4f7..1c6115cb 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1216,7 +1216,7 @@ dacp_reply_playqueuecontents(struct evhttp_request *req, struct evbuffer *evbuf, { ret = safe_atoi32(param, &span); if (ret < 0) - DPRINTF(E_LOG, L_DACP, "Invalid span value in playqueue-contents request\n"); + DPRINTF(E_LOG, L_DACP, "Invalid span value in playqueue-contents request\n"); } songlist = NULL; @@ -1241,54 +1241,53 @@ dacp_reply_playqueuecontents(struct evhttp_request *req, struct evbuffer *evbuf, * otherwise make song list for Up Next and begin with first song after playlist position. */ if (span < 0) - { - history = player_history_get(); - if (abs(span) > history->count) - { - start_index = history->start_index; - } - else - { - start_index = (history->start_index + history->count - abs(span)) % MAX_HISTORY_COUNT; - } - for (n = 0; n < history->count && n < abs(span); n++) - { - ret = playqueuecontents_add_source(songlist, history->id[(start_index + n) % MAX_HISTORY_COUNT], (n + 1), - status.plid); - if (ret < 0) - { - DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n"); + { + history = player_history_get(); + if (abs(span) > history->count) + { + start_index = history->start_index; + } + else + { + start_index = (history->start_index + history->count - abs(span)) % MAX_HISTORY_COUNT; + } + for (n = 0; n < history->count && n < abs(span); n++) + { + ret = playqueuecontents_add_source(songlist, history->id[(start_index + n) % MAX_HISTORY_COUNT], (n + 1), status.plid); + if (ret < 0) + { + DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n"); - dmap_send_error(req, "ceQR", "Out of memory"); - return; - } - } - } + dmap_send_error(req, "ceQR", "Out of memory"); + return; + } + } + } else - { - /* Fast forward to song currently being played */ - head = player_queue_get(); - if (head) - { - ps = head; - while ((ps->id != status.id) && (ps = next_ps(ps, status.shuffle)) && (ps != head)) - i++; + { + /* Fast forward to song currently being played */ + head = player_queue_get(); + if (head) + { + ps = head; + while ((ps->id != status.id) && (ps = next_ps(ps, status.shuffle)) && (ps != head)) + i++; - while ((n < abs(span)) && (ps = next_ps(ps, status.shuffle)) && (ps != head)) - { - n++; + while ((n < abs(span)) && (ps = next_ps(ps, status.shuffle)) && (ps != head)) + { + n++; - ret = playqueuecontents_add_source(songlist, ps->id, (n + i + 1), status.plid); - if (ret < 0) - { - DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n"); + ret = playqueuecontents_add_source(songlist, ps->id, (n + i + 1), status.plid); + if (ret < 0) + { + DPRINTF(E_LOG, L_DACP, "Could not add song to songlist for playqueue-contents\n"); - dmap_send_error(req, "ceQR", "Out of memory"); - return; - } - } - } - } + dmap_send_error(req, "ceQR", "Out of memory"); + return; + } + } + } + } } /* Playlists are hist, curr and main. */ diff --git a/src/player.c b/src/player.c index 1f24a5e0..724970c4 100644 --- a/src/player.c +++ b/src/player.c @@ -1485,18 +1485,18 @@ source_read(uint8_t *buf, int len, uint64_t rtptime) while (nbytes < len) { if (new) - { - DPRINTF(E_DBG, L_PLAYER, "New file\n"); + { + DPRINTF(E_DBG, L_PLAYER, "New file\n"); - new = 0; + new = 0; - // add song to the played history - history_add(cur_streaming->id); + // add song to the played history + history_add(cur_streaming->id); - ret = source_next(0); - if (ret < 0) - return -1; - } + ret = source_next(0); + if (ret < 0) + return -1; + } if (EVBUFFER_LENGTH(audio_buf) == 0) {