clang format

This commit is contained in:
Mike Brady
2022-11-26 19:09:42 +00:00
parent 50738c360d
commit 4044666897
4 changed files with 26 additions and 24 deletions
+7 -10
View 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");
+2 -2
View 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);
}
+16 -10
View File
@@ -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
}
+1 -2
View 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;
}