From 5782ad7468cd740b721fa54fe86a15548ed95031 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Tue, 2 Feb 2021 17:49:46 +0800 Subject: [PATCH] Fix a stupid fifo bug that would orphan enqueued data. This magically didn't really affect normal operation, because in normal operation the demodulator can consume data faster than it is produced, so the fifo never grows beyond 0-1 items. However in cases where the demodulator is slow and the producer is fast (e.g. reading from a file and running with lots of debug on) the fifo would lose buffers as soon as it had more than one pending. --- fifo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fifo.c b/fifo.c index e33a4e2..3939461 100644 --- a/fifo.c +++ b/fifo.c @@ -199,6 +199,7 @@ void fifo_enqueue(struct mag_buf *buf) pthread_cond_signal(&fifo_notempty_cond); } else { fifo_tail->next = buf; + fifo_tail = buf; } done: