Always record frames successfully sent to DAC even if they are less than requested.

This commit is contained in:
Mike Brady
2022-03-16 10:19:15 +11:00
parent 1df7939d6a
commit 8490c4c1c1
+2 -1
View File
@@ -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 */