From: Mike Brady Date: Sun, 9 Sep 2018 19:43:01 +0000 (+0100) Subject: Clang Format Cleanup X-Git-Tag: 3.3RC0~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b18f45facecde24639a4380e98439ee202bd4ec;p=thirdparty%2Fshairport-sync.git Clang Format Cleanup --- diff --git a/audio.h b/audio.h index 171e366b..a4f0f178 100644 --- a/audio.h +++ b/audio.h @@ -24,9 +24,10 @@ typedef struct { // block of samples int (*play)(void *buf, int samples); void (*stop)(void); - + // may be null if no implemented - int (*is_running)(void); // if implemented, will return 0 if everything is okay, non-zero otherwise + int (*is_running)( + void); // if implemented, will return 0 if everything is okay, non-zero otherwise // may be null if not implemented void (*flush)(void); diff --git a/audio_alsa.c b/audio_alsa.c index d0b62532..17b2df4c 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1005,7 +1005,7 @@ static int play(void *buf, int samples) { measurement_time = get_absolute_time_in_fp(); frames_played_at_measurement_time = frames_sent_for_playing - fl; if (frame_index == start_measurement_from_this_frame) { - debug(1,"Start frame counting"); + debug(1, "Start frame counting"); frames_played_at_measurement_start_time = frames_played_at_measurement_time; measurement_start_time = measurement_time; measurement_data_is_valid = 1; diff --git a/common.c b/common.c index f895866c..4a60cfb9 100644 --- a/common.c +++ b/common.c @@ -587,8 +587,6 @@ int config_set_lookup_bool(config_t *cfg, char *where, int *dst) { } } - - void command_set_volume(double volume) { if (config.cmd_set_volume) { /*Spawn a child to run the program.*/ diff --git a/common.h b/common.h index 41844b77..c25b166a 100644 --- a/common.h +++ b/common.h @@ -206,7 +206,8 @@ typedef struct { #ifdef CONFIG_JACK char *jack_client_name, *jack_left_channel_name, *jack_right_channel_name; int jack_auto_client_open_interval; // will try to open a client automatically every second - int jack_auto_client_disconnect; // will disconnect from the server on end of session if set, normally clear. + int jack_auto_client_disconnect; // will disconnect from the server on end of session if set, + // normally clear. #endif } shairport_cfg; diff --git a/player.c b/player.c index 20f01855..9bfc99a7 100644 --- a/player.c +++ b/player.c @@ -835,14 +835,14 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { debug_mutex_unlock(&conn->flush_mutex, 3); } } - + if (config.output->is_running) - if (config.output->is_running() !=0 ) { // if the back end isn't running for any reason - debug(3,"not running"); + if (config.output->is_running() != 0) { // if the back end isn't running for any reason + debug(3, "not running"); debug_mutex_lock(&conn->flush_mutex, 1000, 1); conn->flush_requested = 1; debug_mutex_unlock(&conn->flush_mutex, 3); - } + } debug_mutex_lock(&conn->flush_mutex, 1000, 1); if (conn->flush_requested == 1) { @@ -907,7 +907,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { // player int have_sent_prefiller_silence = 1; // set true when we have sent some silent frames to // the DAC - /* + /* int64_t reference_timestamp; uint64_t reference_timestamp_time, remote_reference_timestamp_time; get_reference_timestamp_stuff(&reference_timestamp, &reference_timestamp_time, @@ -991,7 +991,7 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { &should_be_time, conn); conn->first_packet_time_to_play = should_be_time; - + // now, the size of the initial silence must be affected by the lead-in time. // it must be somewhat less than the lead-in time so that dynamic adjustments can be // made @@ -1175,11 +1175,15 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { // here, get the time to play the current frame. - if (have_timestamp_timing_information(conn)) { // if we have a reference time + if (have_timestamp_timing_information(conn)) { // if we have a reference time uint64_t time_to_play; - frame_to_local_time(curframe->timestamp + conn->latency * conn->output_sample_ratio + (int64_t)(config.audio_backend_latency_offset * config.output_rate) - config.audio_backend_buffer_desired_length * config.output_rate, &time_to_play, conn); - + frame_to_local_time( + curframe->timestamp + conn->latency * conn->output_sample_ratio + + (int64_t)(config.audio_backend_latency_offset * config.output_rate) - + config.audio_backend_buffer_desired_length * config.output_rate, + &time_to_play, conn); + if (local_time_now >= time_to_play) { do_wait = 0; }