aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorHartmut Birr <e9hack@gmail.com>2007-04-22 05:57:26 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:45:48 -0400
commit2970c49270be2a62b1115f73bbfc0b8d3b3f48ba (patch)
treeac7be9756a51567c6c16bb65d644f2d2b8ff7825 /drivers/media/common
parentdc120b0734fcc6a4c42c73790a02f2fa74a7a326 (diff)
V4L/DVB (5545): Saa7146: Release capture buffers on device close
If the video device (saa7146 on a FF card) was open for capturing, the close call didn't release the capture buffers. Signed-off-by: Hartmut Birr <e9hack@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/common')
-rw-r--r--drivers/media/common/saa7146_video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index 7e0cedc557df..e3d04a4cef4d 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -1428,6 +1428,7 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
1428{ 1428{
1429 struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data; 1429 struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
1430 struct saa7146_vv *vv = dev->vv_data; 1430 struct saa7146_vv *vv = dev->vv_data;
1431 struct videobuf_queue *q = &fh->video_q;
1431 int err; 1432 int err;
1432 1433
1433 if (IS_CAPTURE_ACTIVE(fh) != 0) { 1434 if (IS_CAPTURE_ACTIVE(fh) != 0) {
@@ -1436,6 +1437,11 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
1436 err = saa7146_stop_preview(fh); 1437 err = saa7146_stop_preview(fh);
1437 } 1438 }
1438 1439
1440 // release all capture buffers
1441 mutex_lock(&q->lock);
1442 videobuf_read_stop(q);
1443 mutex_unlock(&q->lock);
1444
1439 /* hmm, why is this function declared void? */ 1445 /* hmm, why is this function declared void? */
1440 /* return err */ 1446 /* return err */
1441} 1447}