From a238ac54bb0842eb532a69a06a1f14577a591077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Nettingsmeier?= Date: Thu, 14 Feb 2019 20:50:02 +0000 Subject: [PATCH] audio_occupancy_now in delay() needs to be in frames, not bytes. Still no luck... --- audio_jack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio_jack.c b/audio_jack.c index eb00b666..525eb64b 100644 --- a/audio_jack.c +++ b/audio_jack.c @@ -490,7 +490,7 @@ int jack_delay(long *the_delay) { // this is the buffer occupancy before any // subsequent transfer because transfer is blocked // by the mutex - size_t audio_occupancy_now = jack_ringbuffer_read_space(jackbuf); + size_t audio_occupancy_now = jack_ringbuffer_read_space(jackbuf) / bytes_per_frame; pthread_mutex_unlock(&buffer_mutex); int64_t frames_processed_since_latest_latency_check = (delta * 44100) >> 32;