aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
diff options
context:
space:
mode:
authorAndrea Odetti <mariofutire@gmail.com>2008-04-20 18:37:45 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:09:44 -0300
commit48c01a9c2d245b229f8b709040cb1776b00dc683 (patch)
tree8a33e3640fc89a061222abc9aaddc55be0650dd2 /drivers/media/dvb/dvb-core/dvb_ringbuffer.h
parent3ff9a81b21c673fd91ad8456242ca68922f77ac4 (diff)
V4L/DVB (7658): dvb-core: Fix DMX_SET_BUFFER_SIZE in case the buffer shrinks
This patch fixes the bug in DMX_SET_BUFFER_SIZE for the demux. Basically it resets read and write pointers to 0 in case they are beyond the new size of the buffer. Signed-off-by: Andrea Odetti <mariofutire@gmail.com> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-core/dvb_ringbuffer.h')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_ringbuffer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
index d97714e7573..89082626296 100644
--- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
@@ -69,6 +69,7 @@ struct dvb_ringbuffer {
** to lock read or write operations.
** Two or more readers must be locked against each other.
** Flushing the buffer counts as a read operation.
+** Resetting the buffer counts as a read and write operation.
** Two or more writers must be locked against each other.
*/
@@ -85,6 +86,13 @@ extern ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf);
extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
+/*
+** Reset the read and write pointers to zero and flush the buffer
+** This counts as a read and write operation
+*/
+extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
+
+
/* read routines & macros */
/* ---------------------- */
/* flush buffer */