]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Clang formatted.
authorMike Brady <mikebrady@eircom.net>
Thu, 29 Nov 2018 12:18:07 +0000 (12:18 +0000)
committerMike Brady <mikebrady@eircom.net>
Thu, 29 Nov 2018 12:18:07 +0000 (12:18 +0000)
common.c
common.h
rtp.c
rtsp.c

index f815af91b438995cca80fc117717ac244810ded1..d8fcbd44ad5811ad2d44b4a0d0e8b7215701afd2 100644 (file)
--- a/common.c
+++ b/common.c
@@ -94,10 +94,9 @@ volatile int debuglev = 0;
 
 sigset_t pselect_sigset;
 
-
 int usleep_uncancellable(useconds_t usec) {
-       int response;
-       int oldState;
+  int response;
+  int oldState;
   pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
   response = usleep_uncancellable(usec);
   pthread_setcancelstate(oldState, NULL);
@@ -107,8 +106,8 @@ int usleep_uncancellable(useconds_t usec) {
 static uint16_t UDPPortIndex = 0;
 
 void resetFreeUDPPort() {
-       debug(1,"Resetting UDP Port Suggestion to %u",config.udp_port_base);
-       UDPPortIndex = 0;
+  debug(1, "Resetting UDP Port Suggestion to %u", config.udp_port_base);
+  UDPPortIndex = 0;
 }
 
 uint16_t nextFreeUDPPort() {
index 59492c5f0aeefa182c9db4b760ba262b7832c0e7..ece21b1d3b08477166fba1361c8355f1190209d0 100644 (file)
--- a/common.h
+++ b/common.h
@@ -330,7 +330,7 @@ char *get_version_string(); // mallocs a string space -- remember to free it aft
 
 void sps_nanosleep(const time_t sec,
                    const long nanosec); // waits for this time, even through interruptions
-                   
+
 int usleep_uncancellable(useconds_t usec);
 
 #endif // _COMMON_H
diff --git a/rtp.c b/rtp.c
index bfb32d750cd15f3726a23f76f8c4af87caf85186..61c69dd2694c8e27a6be130c370f15ad77685c7f 100644 (file)
--- a/rtp.c
+++ b/rtp.c
@@ -98,7 +98,7 @@ uint64_t local_to_remote_time_difference_now(rtsp_conn_info *conn) {
 }
 
 void rtp_audio_receiver_cleanup_handler(void *arg) {
-       int oldState;
+  int oldState;
   pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
   debug(3, "Audio Receiver Cleanup.");
   rtsp_conn_info *conn = (rtsp_conn_info *)arg;
@@ -564,13 +564,13 @@ void *rtp_timing_sender(void *arg) {
 }
 
 void rtp_timing_receiver_cleanup_handler(void *arg) {
-       int oldState;
+  int oldState;
   pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
   debug(3, "Timing Receiver Cleanup.");
   rtsp_conn_info *conn = (rtsp_conn_info *)arg;
   debug(3, "Cancel Timing Requester.");
   pthread_cancel(conn->timer_requester);
-  debug(3, "Join Timing Requester.");  
+  debug(3, "Join Timing Requester.");
   pthread_join(conn->timer_requester, NULL);
   debug(3, "Close Timing Socket.");
   close(conn->timing_socket);
@@ -867,16 +867,15 @@ static uint16_t bind_port(int ip_family, const char *self_ip_address, uint32_t s
   int local_socket = socket(ip_family, SOCK_DGRAM, IPPROTO_UDP);
   if (local_socket == -1)
     die("Could not allocate a socket.");
-  
+
   int val = 1;
   ret = setsockopt(local_socket, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));
   if (ret < 0) {
     char errorstring[1024];
     strerror_r(errno, (char *)errorstring, sizeof(errorstring));
-    debug(1,"Error %d: \"%s\". Couldn't set SO_REUSEADDR");
+    debug(1, "Error %d: \"%s\". Couldn't set SO_REUSEADDR");
   }
 
-  
   SOCKADDR myaddr;
   int tryCount = 0;
   uint16_t desired_port;
diff --git a/rtsp.c b/rtsp.c
index 2d1203d78d2e625be4dabb8cd7c3dd60e0a3ef8e..31af30f909825ee934e4dcfc732bc02d6df6a8da 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -571,10 +571,10 @@ enum rtsp_read_request_response rtsp_read_request(rtsp_conn_info *conn, rtsp_mes
       if (errno == EINTR)
         continue;
       if (errno != ECONNRESET) {
-                               char errorstring[1024];
-                               strerror_r(errno, (char *)errorstring, sizeof(errorstring));
-                               debug(1, "Connection %d: rtsp_read_request_response_read_error %d: \"%s\".",
-                                                       conn->connection_number, errno, (char *)errorstring);
+        char errorstring[1024];
+        strerror_r(errno, (char *)errorstring, sizeof(errorstring));
+        debug(1, "Connection %d: rtsp_read_request_response_read_error %d: \"%s\".",
+              conn->connection_number, errno, (char *)errorstring);
       }
       reply = rtsp_read_request_response_read_error;
       goto shutdown;
@@ -924,14 +924,15 @@ void handle_setup(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) {
                                      "timing_port=%d;server_"
                                      "port=%d",
            conn->local_control_port, conn->local_timing_port, conn->local_audio_port);
-  
 
   msg_add_header(resp, "Transport", resphdr);
 
   msg_add_header(resp, "Session", "1");
 
   resp->respcode = 200;
-  debug(1, "Connection %d: SETUP with UDP ports Control: %d, Timing: %d and Audio: %d.", conn->connection_number, conn->local_control_port, conn->local_timing_port, conn->local_audio_port);
+  debug(1, "Connection %d: SETUP with UDP ports Control: %d, Timing: %d and Audio: %d.",
+        conn->connection_number, conn->local_control_port, conn->local_timing_port,
+        conn->local_audio_port);
   return;
 
 error:
@@ -2065,7 +2066,6 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
   if (rc)
     debug(1, "Connection %d: error %d destroying flush_mutex.", conn->connection_number, rc);
 
-
   debug(2, "Cancel watchdog thread.");
   pthread_cancel(conn->player_watchdog_thread);
   int oldState;
@@ -2076,7 +2076,6 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
   debug(2, "Delete watchdog mutex.");
   pthread_mutex_destroy(&conn->watchdog_mutex);
 
-
   debug(3, "Connection %d: Checking play lock.", conn->connection_number);
   debug_mutex_lock(&playing_conn_lock, 1000000, 3); // get it
   if (playing_conn == conn) {
@@ -2084,7 +2083,7 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
     playing_conn = NULL;
   }
   debug_mutex_unlock(&playing_conn_lock, 3);
-  
+
   debug(2, "Connection %d: RTSP thread terminated.", conn->connection_number);
   conn->running = 0;
 }