From fe69d015f0a382482083f2d320a050ec1f8ed9a1 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 12 Oct 2020 17:43:30 +0200 Subject: [PATCH] uldaq: fix buffering issue --- lib/nodes/uldaq.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nodes/uldaq.cpp b/lib/nodes/uldaq.cpp index 5bd63fd25..e7b1a8d59 100644 --- a/lib/nodes/uldaq.cpp +++ b/lib/nodes/uldaq.cpp @@ -607,14 +607,13 @@ int uldaq_read(struct vnode *n, struct sample *smps[], unsigned cnt, unsigned *r pthread_mutex_lock(&u->in.mutex); - if (u->in.status != SS_RUNNING) return -1; size_t start_index = u->in.buffer_pos; /* Wait for data available condition triggered by event callback */ - if (start_index + n->in.vectorize * u->in.channel_count > u->in.transfer_status.currentScanCount) + if (start_index + n->in.vectorize * u->in.channel_count > u->in.transfer_status.currentTotalCount) pthread_cond_wait(&u->in.cv, &u->in.mutex); for (unsigned j = 0; j < cnt; j++) {