diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-13 13:14:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-13 13:14:34 -0300 |
commit | 8dedcbf12153e737c57c521a6fbf108e6f9e81d8 (patch) | |
tree | 014bfe6b3c6fcec4182e6458dc94ec0fa20b2c93 /linux/drivers/media/dvb | |
parent | 1cbfa6bb381bc427843d530820fb666d0ed9a310 (diff) | |
download | mediapointer-dvb-s2-8dedcbf12153e737c57c521a6fbf108e6f9e81d8.tar.gz mediapointer-dvb-s2-8dedcbf12153e737c57c521a6fbf108e6f9e81d8.tar.bz2 |
Make dvb_ringbuffer compatible to dmxdev_buffer
From: Andreas Oberritter <obi@linuxtv.org>
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@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index 77ad2410f..f23324835 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c @@ -45,6 +45,7 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) 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_ringbuffer *rbuf) void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) { - rbuf->pread = rbuf->pwrite; + rbuf->pread = rbuf->pwrite = 0; + rbuf->error = 0; } diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h index 6d2560972..d97714e75 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h @@ -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; |