Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 92732
b: refs/heads/master
c: 48c01a9
h: refs/heads/master
v: v3
  • Loading branch information
Andrea Odetti authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 1be2fe5 commit 0d58684
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ff9a81b21c673fd91ad8456242ca68922f77ac4
refs/heads/master: 48c01a9c2d245b229f8b709040cb1776b00dc683
4 changes: 3 additions & 1 deletion trunk/drivers/media/dvb/dvb-core/dmxdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ static int dvb_dmxdev_set_buffer_size(struct dmxdev_filter *dmxdevfilter,
mem = buf->data;
buf->data = NULL;
buf->size = size;
dvb_ringbuffer_flush(buf);

/* reset and not flush in case the buffer shrinks */
dvb_ringbuffer_reset(buf);
spin_unlock_irq(&dmxdevfilter->dev->lock);
vfree(mem);

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf)
rbuf->error = 0;
}


void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf)
{
rbuf->pread = rbuf->pwrite = 0;
rbuf->error = 0;
}

void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf)
{
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

Expand All @@ -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 */
Expand Down

0 comments on commit 0d58684

Please sign in to comment.