static uint64_t frames_sent_for_playing;
- // set to true if there has been a discontinuity between the last reported frames_sent_for_playing
- // and the present reported frames_sent_for_playing
- // Not that it will be set when the device is opened, as any previous figures for frames_sent_for_playing
- // (which Shairport Sync might hold) would be invalid.
+// set to true if there has been a discontinuity between the last reported frames_sent_for_playing
+// and the present reported frames_sent_for_playing
+// Not that it will be set when the device is opened, as any previous figures for
+// frames_sent_for_playing (which Shairport Sync might hold) would be invalid.
static int frames_sent_break_occurred;
static void help(void) {
if (ret == 0)
ret = frames_sent_break_occurred; // will be zero unless an error like an underrun occurred
else
- ret = 1; // just indicate there was some kind of a break
- frames_sent_break_occurred = 0; // reset it.
+ ret = 1; // just indicate there was some kind of a break
+ frames_sent_break_occurred = 0; // reset it.
if (frames_sent_to_dac != NULL)
*frames_sent_to_dac = frames_sent_for_playing;
debug_mutex_unlock(&alsa_mutex, 0);
frames_sent_for_playing += samples;
} else {
frames_sent_break_occurred = 1; // note than an output error has occurred
- if (ret == -EPIPE) { /* underrun */
+ if (ret == -EPIPE) { /* underrun */
// It could be that the DAC was in the SND_PCM_STATE_XRUN state before
// sending the samples to be output. If so, it will still be in
// do_mute(0); // complete unmute
}
frames_sent_break_occurred = 1; // there is a discontinuity with
- // any previously-reported frame count
+ // any previously-reported frame count
frames_sent_for_playing = 0;
alsa_backend_state = abm_connected; // only do this if it really opened it.
}
uint64_t actual_delay;
stats_status =
config.output->stats(&measurement_time, &actual_delay, &frames_sent_for_play);
- // debug(1,"status: %d, actual_delay: %" PRIu64 ", frames_sent_for_play: %" PRIu64 ", frames_played: %" PRIu64 ".", stats_status, actual_delay, frames_sent_for_play, frames_sent_for_play - actual_delay);
+ // debug(1,"status: %d, actual_delay: %" PRIu64 ", frames_sent_for_play: %" PRIu64 ",
+ // frames_played: %" PRIu64 ".", stats_status, actual_delay, frames_sent_for_play,
+ // frames_sent_for_play - actual_delay);
uint64_t frames_played = frames_sent_for_play - actual_delay;
// If the status is zero, it means that there were no output problems since the
// last time the stats call was made. Thus, the frame rate should be valid.
if (interval != 0) {
conn->frame_rate = (1e9 * frames_played_in_this_interval) / interval;
conn->frame_rate_valid = 1;
- //debug(1,"frames_played_in_this_interval: %" PRIu64 ", interval: %" PRId64 ", rate: %f.",
+ // debug(1,"frames_played_in_this_interval: %" PRIu64 ", interval: %" PRId64 ",
+ // rate: %f.",
// frames_played_in_this_interval, interval, conn->frame_rate);
}
}