summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-dvb.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
index e6e1145a3..97e354d8a 100644
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -98,9 +98,12 @@ static int dvb_thread(void *data)
buf = list_entry(dev->dvbq.stream.next,
struct videobuf_buffer, stream);
list_del(&buf->stream);
- err = videobuf_waiton(buf,0,0);
+ err = videobuf_waiton(buf,0,1);
+ BUG_ON(0 != err);
- /* stop_feed asked us to quit */
+ /* no more feeds left or stop_feed asked us to quit */
+ if (0 == dev->nfeeds)
+ break;
if (kthread_should_stop())
break;
@@ -108,13 +111,13 @@ static int dvb_thread(void *data)
if (buf->state == STATE_DONE)
dvb_dmx_swfilter(&dev->demux, buf->dma.vmalloc,
buf->size);
-
+
/* requeue buffer */
list_add_tail(&buf->stream,&dev->dvbq.stream);
spin_lock_irqsave(dev->dvbq.irqlock,flags);
dev->dvbq.ops->buf_queue(file,buf);
spin_unlock_irqrestore(dev->dvbq.irqlock,flags);
-
+
/* log errors if any */
if (dev->error_count || dev->stopper_count || dev->timeout_count) {
printk("%s: error=%d stopper=%d timeout=%d\n",
@@ -172,6 +175,7 @@ static int dvb_stop_feed(struct dvb_demux_feed *feed)
down(&dev->lock);
dev->nfeeds--;
if (0 == dev->nfeeds && NULL != dev->dvb_thread) {
+ cx8802_cancel_buffers(dev);
err = kthread_stop(dev->dvb_thread);
dev->dvb_thread = NULL;
}