whitespace fixes

This commit is contained in:
James Laird
2013-05-14 09:14:27 +10:00
parent d5b17e2c23
commit 98da1d2f66
9 changed files with 23 additions and 22 deletions
+1 -1
View File
@@ -16,4 +16,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
OTHER DEALINGS IN THE SOFTWARE.
+2 -2
View File
@@ -41,11 +41,11 @@ static audio_output *outputs[] = {
&audio_dummy,
NULL
};
audio_output *audio_get_output(char *name) {
audio_output **out;
// default to the first
if (!name)
return outputs[0];
+2 -2
View File
@@ -52,11 +52,11 @@ static void play(short buf[], int samples) {
// this is all a bit expensive but it's long-term stable.
gettimeofday(&tv, NULL);
long long nowtime = tv.tv_usec + 1e6*tv.tv_sec;
long long nowtime = tv.tv_usec + 1e6*tv.tv_sec;
if (!starttime)
starttime = nowtime;
samples_played += samples;
long long finishtime = starttime + samples_played * 1e6 / Fs;
+2 -2
View File
@@ -102,7 +102,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
while (inlen++ & 3)
BIO_write(bmem, "=", 1);
BIO_flush(bmem);
int bufsize = strlen(input)*3/4 + 1;
uint8_t *buf = malloc(bufsize);
int nread;
@@ -115,7 +115,7 @@ uint8_t *base64_dec(char *input, int *outlen) {
return buf;
}
static char super_secret_key[] =
static char super_secret_key[] =
"-----BEGIN RSA PRIVATE KEY-----\n"
"MIIEpQIBAAKCAQEA59dE8qLieItsH1WgjrcFRKj6eUWqi+bGLOX1HL3U3GhC/j0Qg90u3sG/1CUt\n"
"wC5vOYvfDmFI6oSFXi5ELabWJmT2dKHzBJKa3k9ok+8t9ucRqMd6DZHJ2YCCLlDRKSKv6kDqnw4U\n"
+1
View File
@@ -25,6 +25,7 @@ typedef struct {
audio_output *output;
int buffer_start_fill;
int daemonise;
int mdns_internal;
} shairport_cfg;
extern int debuglev;
+1 -1
View File
@@ -47,7 +47,7 @@ void mdns_register(void) {
if ((mdns_pid = fork()))
return;
char *mdns_apname = malloc(strlen(config.apname) + 14);
char *p = mdns_apname;
int i;
+1 -1
View File
@@ -136,7 +136,7 @@ int rtp_setup(SOCKADDR *remote, int cport, int tport) {
// we do our own timing and ignore the timing port.
// an audio perfectionist may wish to learn the protocol.
memcpy(&rtp_client, remote, sizeof(rtp_client));
#ifdef AF_INET6
if (rtp_client.SAFAMILY == AF_INET6) {
+11 -11
View File
@@ -124,7 +124,7 @@ typedef struct {
static rtsp_message * msg_init(void) {
rtsp_message *msg = malloc(sizeof(rtsp_message));
memset(msg, 0, sizeof(rtsp_message));
memset(msg, 0, sizeof(rtsp_message));
return msg;
}
@@ -179,7 +179,7 @@ static int msg_handle_line(rtsp_message **pmsg, char *line) {
p = strtok_r(NULL, " ", &sp);
if (!p)
goto fail;
p = strtok_r(NULL, " ", &sp);
if (!p)
goto fail;
@@ -221,7 +221,7 @@ static rtsp_message * rtsp_read_request(int fd) {
rtsp_message *msg = NULL;
ssize_t nread;
ssize_t nread;
ssize_t inbuf = 0;
int msg_size = -1;
@@ -426,7 +426,7 @@ static void handle_announce(rtsp_conn_info *conn,
if (!strncmp(cp, "a=rsaaeskey:", 12))
prsaaeskey = cp+12;
cp = next;
}
@@ -455,7 +455,7 @@ static void handle_announce(rtsp_conn_info *conn,
}
memcpy(conn->stream.aeskey, aeskey, 16);
free(aeskey);
int i;
for (i=0; i<sizeof(conn->stream.fmtp)/sizeof(conn->stream.fmtp[0]); i++)
conn->stream.fmtp[i] = atoi(strsep(&pfmtp, " \t"));
@@ -503,7 +503,7 @@ static void apple_challenge(int fd, rtsp_message *req, rtsp_message *resp) {
memcpy(bp, chall, chall_len);
free(chall);
bp += chall_len;
#ifdef AF_INET6
if (fdsa.SAFAMILY == AF_INET6) {
struct sockaddr_in6 *sa6 = (struct sockaddr_in6*)(&fdsa);
@@ -560,7 +560,7 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) {
char *hdr = msg_get_header(req, "Authorization");
if (!hdr || strncmp(hdr, "Digest ", 7))
goto authenticate;
char *realm = strstr(hdr, "realm=\"");
char *username = strstr(hdr, "username=\"");
char *response = strstr(hdr, "response=\"");
@@ -646,7 +646,7 @@ static void *rtsp_conversation_thread_func(void *vfd) {
int fd = *(int*)vfd;
socklen_t slen = sizeof(conn.remote);
fd = accept(fd, (struct sockaddr *)&conn.remote, &slen);
if (fd < 0) {
perror("failed to accept connection");
@@ -667,7 +667,7 @@ static void *rtsp_conversation_thread_func(void *vfd) {
if (rtsp_auth(&auth_nonce, req, resp))
goto respond;
struct method_handler *mh;
for (mh=method_handlers; mh->method; mh++) {
if (!strcmp(mh->method, req->method)) {
@@ -680,7 +680,7 @@ respond:
msg_write_response(fd, resp);
msg_free(req);
msg_free(resp);
}
}
shutdown:
if (fd > 0)
@@ -731,7 +731,7 @@ void rtsp_listen_loop(void) {
if (ret) {
die("getaddrinfo failed: %s\n", gai_strerror(ret));
}
for (p=info; p; p=p->ai_next) {
int fd = socket(p->ai_family, p->ai_socktype, IPPROTO_TCP);
int yes = 1;
+2 -2
View File
@@ -124,7 +124,7 @@ void signal_setup(void) {
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = &sig_ignore;
sigaction(SIGUSR1, &sa, NULL);
sa.sa_sigaction = &sig_shutdown;
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
@@ -144,7 +144,7 @@ int main(int argc, char **argv) {
snprintf(config.apname, 20 + 100, "Shairport on %s", hostname);
int audio_arg = parse_options(argc, argv);
config.output = audio_get_output(config.output_name);
if (!config.output) {
audio_ls_outputs();