]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Clang Format
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 27 Sep 2020 09:45:22 +0000 (10:45 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sun, 27 Sep 2020 09:45:22 +0000 (10:45 +0100)
audio_pipe.c
common.c
dacp.c
player.h
rtsp.c
shairport.c

index 5e82496c80749d78173eccb356a7467ca15ff5f4..a7925fbc565c71f7f1a8803f557b1c1c3e94e613 100644 (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);
index cdd4d03115f05bddd87cedacd2d98097d307b3e9..b48adad4952cf66d107de40da2b3d85219099a7b 100644 (file)
--- 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 77313f73cd2f156619cddf12877c07b4870d0fbc..acb963b9aa42c8c4bdb2d285dd423bb6218ba573 100644 (file)
--- 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;
     }
   }
 }
index 013dfb6fd679ff5af6d9bcc8c3ea1bc4abd9d629..105ce869810ac80876340531337ddeb8c742eb3c 100644 (file)
--- 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 974c8a400789e8fca41bea04e5091b9771c5e4c0..8616a61732b523f1434d642fba6ee067b271ecd9 100644 (file)
--- 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;
       }
     }
 
index 127b23f64ef19a4fc2dad17121dbe30e8297ec6b..ba99523330b72fa32517ce386544fc0b738fc994 100644 (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);