From 63391a3be62e65fe1a6328bdfcf78843219a49e0 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Wed, 16 Oct 2024 09:56:06 -0700 Subject: [PATCH] Fix faulty PCM playback logic. --- backends/playback/zsm/zsm_backend.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/playback/zsm/zsm_backend.hpp b/backends/playback/zsm/zsm_backend.hpp index d8f0286..c5e6037 100644 --- a/backends/playback/zsm/zsm_backend.hpp +++ b/backends/playback/zsm/zsm_backend.hpp @@ -85,7 +85,7 @@ class ZsmBackend : public PlaybackBackend { } void audio_step(size_t samples) { if (samples == 0) return; - while (pcm_fifo_avail() < samples) { + while (remain != 0 && pcm_fifo_avail() < samples) { if (pcm_read_rate() == 0) break; if ((--remain) == 0) { if (islooped) {