summaryrefslogtreecommitdiff
path: root/linux/drivers/media/common
diff options
context:
space:
mode:
authorOliver Endriss <o.endriss@gmx.de>2007-04-22 11:57:26 +0200
committerOliver Endriss <o.endriss@gmx.de>2007-04-22 11:57:26 +0200
commitf8f4e35e3832c0625c63a638151b36a412dcfa3c (patch)
treee7b77ffa32f441c523be3a96542bdfcb84f733f8 /linux/drivers/media/common
parentb8bbfddfa7d568d71763d084a289e2e3e46a5f14 (diff)
downloadmediapointer-dvb-s2-f8f4e35e3832c0625c63a638151b36a412dcfa3c.tar.gz
mediapointer-dvb-s2-f8f4e35e3832c0625c63a638151b36a412dcfa3c.tar.bz2
saa7146: Release capture buffers on device close
From: Hartmut Birr <e9hack@gmail.com> 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>
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r--linux/drivers/media/common/saa7146_video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index 35288c4bc..d3537ff4f 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1429,6 +1429,7 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
{
struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
struct saa7146_vv *vv = dev->vv_data;
+ struct videobuf_queue *q = &fh->video_q;
int err;
if (IS_CAPTURE_ACTIVE(fh) != 0) {
@@ -1437,6 +1438,11 @@ static void video_close(struct saa7146_dev *dev, struct file *file)
err = saa7146_stop_preview(fh);
}
+ // release all capture buffers
+ mutex_lock(&q->lock);
+ videobuf_read_stop(q);
+ mutex_unlock(&q->lock);
+
/* hmm, why is this function declared void? */
/* return err */
}