From f8bb20fe7d79c6c1b6ce12c491f9822f788a9c3c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 14 Jan 2023 19:57:02 -0800 Subject: jack: maintain avd variable This is necessary for keeping A-V in sync, and when not done at all is simply broken. --- src/rmd_jack.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/rmd_jack.c b/src/rmd_jack.c index 4168a35..77e500e 100644 --- a/src/rmd_jack.c +++ b/src/rmd_jack.c @@ -62,6 +62,9 @@ static int rmdJackCapture(jack_nframes_t nframes, void *jdata_t) for (int i = 0; i < jdata->nports; i++) jdata->portbuf[i] = jack_port_get_buffer(jdata->ports[i], nframes); + pthread_mutex_lock(&jdata->pdata->avd_mutex); + jdata->pdata->avd -= jdata->pdata->periodtime_us; + pthread_mutex_unlock(&jdata->pdata->avd_mutex); pthread_mutex_lock(jdata->sound_buffer_mutex); //vorbis analysis buffer wants uninterleaved data -- cgit v1.2.3