diff options
Diffstat (limited to 'linux/drivers/media/common/saa7146_vbi.c')
-rw-r--r-- | linux/drivers/media/common/saa7146_vbi.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index 28266dc7d..f9a815cc8 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -316,7 +316,7 @@ static void vbi_stop(struct saa7146_fh *fh) struct saa7146_vv *vv = dev->vv_data; unsigned long flags; DEB_VBI(("dev:%p, fh:%p\n",dev, fh)); - + spin_lock_irqsave(&dev->slock,flags); /* disable rps1 */ @@ -328,12 +328,17 @@ static void vbi_stop(struct saa7146_fh *fh) /* shut down dma 3 transfers */ saa7146_write(dev, MC1, MASK_20); + if (vv->vbi_q.curr) { + saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); + } + + videobuf_queue_cancel(file,&fh->vbi_q); + vv->vbi_streaming = NULL; del_timer(&vv->vbi_q.timeout); del_timer(&fh->vbi_read_timeout); - DEB_VBI(("out\n")); spin_unlock_irqrestore(&dev->slock, flags); } @@ -420,17 +425,9 @@ static void vbi_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct fil unsigned long flags; DEB_VBI(("dev:%p, fh:%p\n",dev,fh)); - spin_lock_irqsave(&dev->slock,flags); - - videobuf_queue_cancel(file,&fh->vbi_q); - if (vv->vbi_q.curr) { - saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); - } - if( fh == vv->vbi_streaming ) { vbi_stop(fh); } - spin_unlock_irqrestore(&dev->slock,flags); } static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) |