Skip to content

Commit

Permalink
Clang Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Sep 27, 2020
1 parent 6857d06 commit 3fc9570
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 35 deletions.
8 changes: 4 additions & 4 deletions audio_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ static int init(int argc, char **argv) {
if (argc == 1)
pipename = argv[0]; // command line argument has priority

if ((pipename) && (strcasecmp(pipename, "STDOUT") == 0))
die("Can't use \"pipe\" backend for STDOUT. Use the \"stdout\" backend instead.");
if ((pipename) && (strcasecmp(pipename, "STDOUT") == 0))
die("Can't use \"pipe\" backend for STDOUT. Use the \"stdout\" backend instead.");

if (pipename == NULL)
pipename = default_pipe_name; // if none specified
if (pipename == NULL)
pipename = default_pipe_name; // if none specified

// here, create the pipe
mode_t oldumask = umask(000);
Expand Down
4 changes: 2 additions & 2 deletions common.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ int create_log_file(const char *path) {
if (flags == -1) {
// strerror_r(errno, (char
//*)errorstring, sizeof(errorstring));
//debug(1, "create_log_file -- error %d (\"%s\") getting flags of pipe: \"%s\".",
// debug(1, "create_log_file -- error %d (\"%s\") getting flags of pipe: \"%s\".",
// errno,
// (char *)errorstring, pathname);
} else {
flags = fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
// if (flags == -1) {
// strerror_r(errno,
//(char *)errorstring, sizeof(errorstring));
//debug(1, "create_log_file -- error %d
// debug(1, "create_log_file -- error %d
//(\"%s\") unsetting NONBLOCK of pipe: \"%s\".", errno,
//(char *)errorstring, pathname);
}
Expand Down
46 changes: 23 additions & 23 deletions dacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,11 @@ void set_dacp_server_information(rtsp_conn_info *conn) {
}
}
if (dacp_server.active_remote_id)
free(dacp_server.active_remote_id);
dacp_server.active_remote_id = strdup(conn->dacp_active_remote); // even if the dacp_id remains the same,
// the active remote will change.
debug(3, "set_dacp_server_information set active-remote id to %s.",
dacp_server.active_remote_id);
free(dacp_server.active_remote_id);
dacp_server.active_remote_id =
strdup(conn->dacp_active_remote); // even if the dacp_id remains the same,
// the active remote will change.
debug(3, "set_dacp_server_information set active-remote id to %s.", dacp_server.active_remote_id);
pthread_cond_signal(&dacp_server_information_cv);
debug_mutex_unlock(&dacp_server_information_lock, 3);
}
Expand All @@ -460,23 +460,23 @@ void dacp_monitor_port_update_callback(char *dacp_id, uint16_t port) {
"number %d.",
dacp_id, dacp_server.dacp_id, port);
if ((dacp_id == NULL) || (dacp_server.dacp_id == NULL)) {
warn("dacp_id or dacp_server.dacp_id NULL detected");
warn("dacp_id or dacp_server.dacp_id NULL detected");
} else {
if (strcmp(dacp_id, dacp_server.dacp_id) == 0) {
dacp_server.port = port;
if (port == 0)
dacp_server.scan_enable = 0;
else {
dacp_server.scan_enable = 1;
// debug(2, "dacp_monitor_port_update_callback enables scan");
}
// metadata_hub_modify_prolog();
// int ch = metadata_store.dacp_server_active != dacp_server.scan_enable;
// metadata_store.dacp_server_active = dacp_server.scan_enable;
// metadata_hub_modify_epilog(ch);
} else {
debug(1, "dacp port monitor reporting on an out-of-use remote.");
}
if (strcmp(dacp_id, dacp_server.dacp_id) == 0) {
dacp_server.port = port;
if (port == 0)
dacp_server.scan_enable = 0;
else {
dacp_server.scan_enable = 1;
// debug(2, "dacp_monitor_port_update_callback enables scan");
}
// metadata_hub_modify_prolog();
// int ch = metadata_store.dacp_server_active != dacp_server.scan_enable;
// metadata_store.dacp_server_active = dacp_server.scan_enable;
// metadata_hub_modify_epilog(ch);
} else {
debug(1, "dacp port monitor reporting on an out-of-use remote.");
}
}
pthread_cond_signal(&dacp_server_information_cv);
debug_mutex_unlock(&dacp_server_information_lock, 3);
Expand Down Expand Up @@ -1006,8 +1006,8 @@ void dacp_monitor_stop() {
pthread_cond_destroy(&dacp_server_information_cv);
debug(3, "DACP Server Information Condition Variable destroyed.");
if (dacp_server.active_remote_id) {
free(dacp_server.active_remote_id);
dacp_server.active_remote_id = NULL;
free(dacp_server.active_remote_id);
dacp_server.active_remote_id = NULL;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions player.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ typedef struct {
char *dacp_id; // id of the client -- used to find the port to be used
// uint16_t dacp_port; // port on the client to send remote control messages to, else
// zero
char *dacp_active_remote; // key to send to the remote controller
void *dapo_private_storage; // this is used for compatibility, if dacp stuff isn't enabled.
char *dacp_active_remote; // key to send to the remote controller
void *dapo_private_storage; // this is used for compatibility, if dacp stuff isn't enabled.

int enable_dither; // needed for filling silences before play actually starts
uint64_t dac_buffer_queue_minimum_length;
Expand Down
6 changes: 3 additions & 3 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
} else {
debug(2, "Connection %d: SETUP -- Note: no Active-Remote information the SETUP Record.",
conn->connection_number);
if (conn->dacp_active_remote) {// this is in case SETUP was previously called
if (conn->dacp_active_remote) { // this is in case SETUP was previously called
free(conn->dacp_active_remote);
conn->dacp_active_remote = NULL;
}
Expand All @@ -1002,9 +1002,9 @@ void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
} else {
debug(2, "Connection %d: SETUP doesn't include DACP-ID string information.",
conn->connection_number);
if (conn->dacp_id) {// this is in case SETUP was previously called
if (conn->dacp_id) { // this is in case SETUP was previously called
free(conn->dacp_id);
conn->dacp_id = NULL;
conn->dacp_id = NULL;
}
}

Expand Down
3 changes: 2 additions & 1 deletion shairport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,8 @@ int main(int argc, char **argv) {

config.output = audio_get_output(config.output_name);
if (!config.output) {
die("Invalid audio backend \"%s\" selected!", config.output_name == NULL ? "<unspecified>" : config.output_name);
die("Invalid audio backend \"%s\" selected!",
config.output_name == NULL ? "<unspecified>" : config.output_name);
}
config.output->init(argc - audio_arg, argv + audio_arg);

Expand Down

0 comments on commit 3fc9570

Please sign in to comment.