bytes that entered the FIFO. The counter may overflow, so it
should be used with "modulo 2^32" arithmetic. The counter will
be used later to synchronize playback to record. No behaviour
change.
ok jakemsr
-/* $OpenBSD: abuf.c,v 1.4 2008/08/14 09:44:15 ratchov Exp $ */
+/* $OpenBSD: abuf.c,v 1.5 2008/08/14 09:46:36 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
buf->len = len;
buf->used = 0;
buf->start = 0;
+ buf->abspos = 0;
buf->silence = 0;
buf->drop = 0;
buf->rproc = NULL;
buf->start += count;
if (buf->start >= buf->len)
buf->start -= buf->len;
+ buf->abspos += count;
}
/*
-/* $OpenBSD: abuf.h,v 1.6 2008/08/14 09:44:15 ratchov Exp $ */
+/* $OpenBSD: abuf.h,v 1.7 2008/08/14 09:46:36 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
unsigned start; /* offset where data starts */
unsigned used; /* valid data */
unsigned len; /* size of the ring */
+ unsigned abspos; /* frame number of the start position */
unsigned silence; /* silence to insert on next write */
unsigned drop; /* frames to drop on next read */
struct aproc *rproc; /* reader */