diff --git a/backends/playback/zsm/zsm_backend.hpp b/backends/playback/zsm/zsm_backend.hpp index 3695620..702c6ea 100644 --- a/backends/playback/zsm/zsm_backend.hpp +++ b/backends/playback/zsm/zsm_backend.hpp @@ -87,11 +87,10 @@ class ZsmBackend : public PlaybackBackend { if (samples == 0) return; while (pcm_fifo_avail() < samples && remain > 0) { if (pcm_read_rate() == 0) break; - remain--; - if (remain == 0) { + if ((--remain) == 0) { if (islooped) { cur = loop; - remain = loop_rem; + remain = loop_rem - 1; } else { break; }