Clang Format

This commit is contained in:
Mike Brady
2020-09-27 10:45:22 +01:00
parent 6857d06bd6
commit 3fc9570489
6 changed files with 36 additions and 35 deletions
+4 -4
View File
@@ -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);
+2 -2
View File
@@ -171,7 +171,7 @@ 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 {
@@ -179,7 +179,7 @@ int create_log_file(const char *path) {
// 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);
}
+23 -23
View File
@@ -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);
}
@@ -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);
@@ -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;
}
}
}
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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;
}
@@ -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;
}
}
+2 -1
View File
@@ -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);