From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 15 Mar 2022 23:19:15 +0000 (+1100) Subject: Always record frames successfully sent to DAC even if they are less than requested. X-Git-Tag: 4.1-rc1~24^2~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8490c4c1c10a16e54a00f8bc8fa737047f35cdb2;p=thirdparty%2Fshairport-sync.git Always record frames successfully sent to DAC even if they are less than requested. --- diff --git a/audio_alsa.c b/audio_alsa.c index d02c8a78..373b1db9 100644 --- a/audio_alsa.c +++ b/audio_alsa.c @@ -1727,9 +1727,10 @@ int do_play(void *buf, int samples) { snd_pcm_state_t prior_state = state; // keep this for afterwards.... // debug(3, "alsa: write %d frames.", samples); ret = alsa_pcm_write(alsa_handle, buf, samples); + if (ret > 0) + frames_sent_for_playing += ret; // this is the number of frames accepted if (ret == samples) { stall_monitor_frame_count += samples; - frames_sent_for_playing += samples; } else { frames_sent_break_occurred = 1; // note than an output error has occurred if (ret == -EPIPE) { /* underrun */