diff options
author | Andrea Odetti <mariofutire@gmail.com> | 2008-04-20 18:37:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 14:09:44 -0300 |
commit | 48c01a9c2d245b229f8b709040cb1776b00dc683 (patch) | |
tree | 8a33e3640fc89a061222abc9aaddc55be0650dd2 /drivers/media/dvb/dvb-core/dmxdev.c | |
parent | 3ff9a81b21c673fd91ad8456242ca68922f77ac4 (diff) | |
download | op-kernel-dev-48c01a9c2d245b229f8b709040cb1776b00dc683.zip op-kernel-dev-48c01a9c2d245b229f8b709040cb1776b00dc683.tar.gz |
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>
Diffstat (limited to 'drivers/media/dvb/dvb-core/dmxdev.c')
-rw-r--r-- | drivers/media/dvb/dvb-core/dmxdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 3415a3b..bbd52be 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c @@ -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); |