V4L/DVB (7658): dvb-core: Fix DMX_SET_BUFFER_SIZE in case the buffer shrinks
This patch fixes the bug in DMX_SET_BUFFER_SIZE for the demux. Basically it resets read and write pointers to 0 in case they are beyond the new size of the buffer. Signed-off-by: Andrea Odetti <mariofutire@gmail.com> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
3ff9a81b21
commit
48c01a9c2d
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user