diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2008-04-20 20:37:45 +0200 |
---|---|---|
committer | Oliver Endriss <o.endriss@gmx.de> | 2008-04-20 20:37:45 +0200 |
commit | feb0491ab7d2fa9ebf1665bfb15df725b1ecd9db (patch) | |
tree | 2883bd37298f90bf8388e7134e2a948f4d04671c /linux/drivers/media/dvb/dvb-core/dmxdev.c | |
parent | eb66d59f64f9a1ef31afcc6225abc5e39aa7fa40 (diff) | |
download | mediapointer-dvb-s2-feb0491ab7d2fa9ebf1665bfb15df725b1ecd9db.tar.gz mediapointer-dvb-s2-feb0491ab7d2fa9ebf1665bfb15df725b1ecd9db.tar.bz2 |
dvb-core: Fix DMX_SET_BUFFER_SIZE in case the buffer shrinks
From: Andrea Odetti <mariofutire@gmail.com>
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>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dmxdev.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dmxdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c index 3415a3bb3..bbd52be55 100644 --- a/linux/drivers/media/dvb/dvb-core/dmxdev.c +++ b/linux/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); |