// 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);
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;
#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;
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) {
// 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,
&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
// 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;
}