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>
This commit is contained in:
parent
fc34f16531
commit
9d9d6baeca
2 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue