From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sun, 27 Sep 2020 09:45:22 +0000 (+0100) Subject: Clang Format X-Git-Tag: 3.3.8~16^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fc95704899324784e654cf5edf92cd162d0ddee;p=thirdparty%2Fshairport-sync.git Clang Format --- diff --git a/audio_pipe.c b/audio_pipe.c index 5e82496c..a7925fbc 100644 --- a/audio_pipe.c +++ b/audio_pipe.c @@ -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); diff --git a/common.c b/common.c index cdd4d031..b48adad4 100644 --- a/common.c +++ b/common.c @@ -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); } diff --git a/dacp.c b/dacp.c index 77313f73..acb963b9 100644 --- a/dacp.c +++ b/dacp.c @@ -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; } } } diff --git a/player.h b/player.h index 013dfb6f..105ce869 100644 --- a/player.h +++ b/player.h @@ -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; diff --git a/rtsp.c b/rtsp.c index 974c8a40..8616a617 100644 --- a/rtsp.c +++ b/rtsp.c @@ -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; } } diff --git a/shairport.c b/shairport.c index 127b23f6..ba995233 100644 --- a/shairport.c +++ b/shairport.c @@ -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 ? "" : config.output_name); + die("Invalid audio backend \"%s\" selected!", + config.output_name == NULL ? "" : config.output_name); } config.output->init(argc - audio_arg, argv + audio_arg);