[PATCH] make dvb_ringbuffer compatible to dmxdev_buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andreas Oberritter <obi@xxxxxxxxxxx>

Added variable 'error' to struct dvb_ringbuffer, which is set to zero on
init() and flush(). Also reset read an write pointers to zero on flush()
to get less fragmented data.

Signed-off-by: Andreas Oberritter <obi@xxxxxxxxxxx>
---

A patch to make dmxdev use dvb_ringbuffer will follow.

diff -r 427667c87c7b linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c	Sun Mar 12 00:03:47 2006 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c	Mon Mar 13 16:02:46 2006 +0100
@@ -45,6 +45,7 @@ void dvb_ringbuffer_init(struct dvb_ring
 	rbuf->pread=rbuf->pwrite=0;
 	rbuf->data=data;
 	rbuf->size=len;
+	rbuf->error=0;
 
 	init_waitqueue_head(&rbuf->queue);
 
@@ -86,7 +87,8 @@ ssize_t dvb_ringbuffer_avail(struct dvb_
 
 void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf)
 {
-	rbuf->pread = rbuf->pwrite;
+	rbuf->pread = rbuf->pwrite = 0;
+	rbuf->error = 0;
 }
 
 
diff -r 427667c87c7b linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h	Sun Mar 12 00:03:47 2006 -0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h	Mon Mar 13 16:02:46 2006 +0100
@@ -35,6 +35,7 @@ struct dvb_ringbuffer {
 	ssize_t           size;
 	ssize_t           pread;
 	ssize_t           pwrite;
+	int               error;
 
 	wait_queue_head_t queue;
 	spinlock_t        lock;



_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux