From 86e6c8cbd39e3f5ff9f121ff23f1c0b1741781b3 Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Mon, 6 Sep 2004 10:40:21 +0000 Subject: - cx88: misc dvb tweaks. --- linux/drivers/media/video/cx88/cx88-dvb.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media/video/cx88/cx88-dvb.c') 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; } -- cgit v1.2.3