From: Jörn Nettingsmeier Date: Thu, 14 Feb 2019 20:50:02 +0000 (+0000) Subject: audio_occupancy_now in delay() needs to be in frames, not bytes. Still no luck... X-Git-Tag: 3.3RC0~52^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a238ac54bb0842eb532a69a06a1f14577a591077;p=thirdparty%2Fshairport-sync.git audio_occupancy_now in delay() needs to be in frames, not bytes. Still no luck... --- 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;