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.
This commit is contained in:
Oliver Jowett 2021-02-02 17:49:46 +08:00
parent fdc1ac731d
commit 5782ad7468
1 changed files with 1 additions and 0 deletions

1
fifo.c
View File

@ -199,6 +199,7 @@ void fifo_enqueue(struct mag_buf *buf)
pthread_cond_signal(&fifo_notempty_cond); pthread_cond_signal(&fifo_notempty_cond);
} else { } else {
fifo_tail->next = buf; fifo_tail->next = buf;
fifo_tail = buf;
} }
done: done: