diff options
author | Andreas Oberritter <obi@linuxtv.org> | 2006-03-13 11:14:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 11:53:17 -0500 |
commit | 9d9d6baeca6f9174b8e7fd219a62a8fa09d61cc7 (patch) | |
tree | d98ceaf625ca9b16536b641476c9fc93177bd79b /drivers | |
parent | fc34f165317403444d254a27bc356dc5de0bbc3d (diff) |
V4L/DVB (3484): Make dvb_ringbuffer compatible to dmxdev_buffer
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 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ringbuffer.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ringbuffer.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c index 77ad2410f4d3..f233248358c4 100644 --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c +++ b/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) | |||
45 | rbuf->pread=rbuf->pwrite=0; | 45 | rbuf->pread=rbuf->pwrite=0; |
46 | rbuf->data=data; | 46 | rbuf->data=data; |
47 | rbuf->size=len; | 47 | rbuf->size=len; |
48 | rbuf->error=0; | ||
48 | 49 | ||
49 | init_waitqueue_head(&rbuf->queue); | 50 | init_waitqueue_head(&rbuf->queue); |
50 | 51 | ||
@@ -86,7 +87,8 @@ ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf) | |||
86 | 87 | ||
87 | void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) | 88 | void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf) |
88 | { | 89 | { |
89 | rbuf->pread = rbuf->pwrite; | 90 | rbuf->pread = rbuf->pwrite = 0; |
91 | rbuf->error = 0; | ||
90 | } | 92 | } |
91 | 93 | ||
92 | 94 | ||
diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h index 6d2560972771..d97714e75736 100644 --- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h +++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h | |||
@@ -35,6 +35,7 @@ struct dvb_ringbuffer { | |||
35 | ssize_t size; | 35 | ssize_t size; |
36 | ssize_t pread; | 36 | ssize_t pread; |
37 | ssize_t pwrite; | 37 | ssize_t pwrite; |
38 | int error; | ||
38 | 39 | ||
39 | wait_queue_head_t queue; | 40 | wait_queue_head_t queue; |
40 | spinlock_t lock; | 41 | spinlock_t lock; |