summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-14 19:57:02 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-14 19:57:02 -0800
commitf8bb20fe7d79c6c1b6ce12c491f9822f788a9c3c (patch)
tree429fa58717622df04846718e831433ecfa641db7
parent668522d772ee1e940ad7f1799299d359ae3df58c (diff)
jack: maintain avd variable
This is necessary for keeping A-V in sync, and when not done at all is simply broken.
-rw-r--r--src/rmd_jack.c3
1 files changed, 3 insertions, 0 deletions
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
© All Rights Reserved