]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
clang format
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 26 Nov 2022 19:09:42 +0000 (19:09 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Sat, 26 Nov 2022 19:09:42 +0000 (19:09 +0000)
dbus-service.c
metadata_hub.c
player.c
shairport.c

index a61616c96d5bfff83fb4819d8417730141ba3577..e957dfa5c9374b1eab79f7451de743caf8f63249 100644 (file)
@@ -102,8 +102,7 @@ void dbus_metadata_watcher(struct metadata_bundle *argc, __attribute__((unused))
     th = shairport_sync_get_frame_position(shairportSyncSkeleton);
     if ((th == NULL) || (strcasecmp(th, argc->frame_position_string) != 0)) {
       // debug(1, "Frame position string should be changed");
-      shairport_sync_set_frame_position(shairportSyncSkeleton,
-                                                        argc->frame_position_string);
+      shairport_sync_set_frame_position(shairportSyncSkeleton, argc->frame_position_string);
     }
   }
 
@@ -864,17 +863,16 @@ static gboolean on_handle_drop_session(ShairportSync *skeleton, GDBusMethodInvoc
 }
 
 static gboolean on_handle_set_frame_position_update_interval(ShairportSync *skeleton,
-                                             GDBusMethodInvocation *invocation,
-                                             const gdouble seconds,
-                                             __attribute__((unused)) gpointer user_data) {
+                                                             GDBusMethodInvocation *invocation,
+                                                             const gdouble seconds,
+                                                             __attribute__((unused))
+                                                             gpointer user_data) {
   debug(1, ">> set frame position update interval to %.6f.", seconds);
   config.metadata_progress_interval = seconds;
   shairport_sync_complete_set_frame_position_update_interval(skeleton, invocation);
   return TRUE;
 }
 
-
-
 static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name,
                                   __attribute__((unused)) gpointer user_data) {
 
@@ -934,8 +932,7 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
                    NULL);
 
   g_signal_connect(shairportSyncSkeleton, "handle-set-frame-position-update-interval",
-                   G_CALLBACK(on_handle_set_frame_position_update_interval),
-                   NULL);
+                   G_CALLBACK(on_handle_set_frame_position_update_interval), NULL);
 
   g_signal_connect(shairportSyncDiagnosticsSkeleton, "notify::verbosity",
                    G_CALLBACK(notify_verbosity_callback), NULL);
@@ -996,7 +993,7 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
                                         config.loudness_reference_volume_db);
   shairport_sync_set_drift_tolerance(SHAIRPORT_SYNC(shairportSyncSkeleton), config.tolerance);
   shairport_sync_set_volume(SHAIRPORT_SYNC(shairportSyncSkeleton), config.airplay_volume);
-  
+
 #ifdef CONFIG_APPLE_ALAC
   if (config.use_apple_decoder == 0) {
     shairport_sync_set_alacdecoder(SHAIRPORT_SYNC(shairportSyncSkeleton), "hammerton");
index db7eeef546137071a949617c2805b7f2b2bf7176..1d9a9a286a9dc0660dba7c3f55de1cc2fce7b846 100644 (file)
@@ -586,8 +586,8 @@ void metadata_hub_process_metadata(uint32_t type, uint32_t code, char *data, uin
       break;
     case 'phbt':
       cs = strndup(data, length);
-      if (string_update(&metadata_store.frame_position_string, &metadata_store.frame_position_string_changed,
-                        cs)) {
+      if (string_update(&metadata_store.frame_position_string,
+                        &metadata_store.frame_position_string_changed, cs)) {
         changed = 1;
         debug(2, "MH Frame Position String set to: \"%s\"", metadata_store.progress_string);
       }
index 9351298303dae33737d07a368194daa4a94c8efc..3c5b1d99df95164c0bedc7d390a31677c9a5ec60 100644 (file)
--- a/player.c
+++ b/player.c
@@ -2199,7 +2199,7 @@ void *player_thread_func(void *arg) {
 
   debug(2, "Play begin");
   while (1) {
-    int this_is_the_first_frame = 0; //will be set if it is
+    int this_is_the_first_frame = 0; // will be set if it is
     // check a few parameters to ensure they are non-zero
     if (config.output_rate == 0)
       debug(1, "config.output_rate is zero!");
@@ -3044,16 +3044,18 @@ void *player_thread_func(void *arg) {
                   }
                   uint64_t should_be_time;
                   frame_to_local_time(inframe->given_timestamp, &should_be_time, conn);
-                  
+
                   config.output->play(conn->outbuf, play_samples, play_samples_are_timed,
                                       inframe->given_timestamp, should_be_time);
 #ifdef CONFIG_METADATA
-                  // debug(1,"config.metadata_progress_interval is %f.", config.metadata_progress_interval);
+                  // debug(1,"config.metadata_progress_interval is %f.",
+                  // config.metadata_progress_interval);
                   if (config.metadata_progress_interval != 0.0) {
                     char hb[128];
                     if (this_is_the_first_frame != 0) {
                       memset(hb, 0, 128);
-                      snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp, should_be_time);
+                      snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp,
+                               should_be_time);
                       send_ssnc_metadata('phbt', hb, strlen(hb), 1);
                       time_of_last_metadata_progress_update = local_time_now;
                     } else {
@@ -3063,11 +3065,12 @@ void *player_thread_func(void *arg) {
                       int64_t delta = iv - local_time_now;
                       if (delta <= 0) {
                         memset(hb, 0, 128);
-                        snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp, should_be_time);
+                        snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp,
+                                 should_be_time);
                         send_ssnc_metadata('phbt', hb, strlen(hb), 1);
                         time_of_last_metadata_progress_update = local_time_now;
                       }
-                    }                
+                    }
                   }
 #endif
                 }
@@ -3120,12 +3123,14 @@ void *player_thread_func(void *arg) {
               config.output->play(conn->outbuf, play_samples, play_samples_are_timed,
                                   inframe->given_timestamp, should_be_time);
 #ifdef CONFIG_METADATA
-              // debug(1,"config.metadata_progress_interval is %f.", config.metadata_progress_interval);
+              // debug(1,"config.metadata_progress_interval is %f.",
+              // config.metadata_progress_interval);
               if (config.metadata_progress_interval != 0.0) {
                 char hb[128];
                 if (this_is_the_first_frame != 0) {
                   memset(hb, 0, 128);
-                  snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp, should_be_time);
+                  snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp,
+                           should_be_time);
                   send_ssnc_metadata('phbt', hb, strlen(hb), 1);
                   time_of_last_metadata_progress_update = local_time_now;
                 } else {
@@ -3135,11 +3140,12 @@ void *player_thread_func(void *arg) {
                   int64_t delta = iv - local_time_now;
                   if (delta <= 0) {
                     memset(hb, 0, 128);
-                    snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp, should_be_time);
+                    snprintf(hb, 127, "%" PRIu32 "/%" PRId64 "", inframe->given_timestamp,
+                             should_be_time);
                     send_ssnc_metadata('phbt', hb, strlen(hb), 1);
                     time_of_last_metadata_progress_update = local_time_now;
                   }
-                }                
+                }
               }
 #endif
             }
index a5e521fffd364a5f7b74ad5304a4e593e40a344e..96fdcbec5fd8029f6bf993bf778bd40806c232d6 100644 (file)
@@ -998,12 +998,11 @@ int parse_options(int argc, char **argv) {
       if (config_lookup_string(config.cfg, "metadata.pipe_name", &str)) {
         config.metadata_pipename = (char *)str;
       }
-      
+
       if (config_lookup_float(config.cfg, "metadata.progress_interval", &dvalue)) {
         config.metadata_progress_interval = dvalue;
       }
 
-
       if (config_lookup_string(config.cfg, "metadata.socket_address", &str)) {
         config.metadata_sockaddr = (char *)str;
       }