summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/common/saa7146_video.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index d59946c27..275043196 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -327,12 +327,12 @@ int saa7146_stop_preview(struct saa7146_fh *fh)
/* check if overlay is running at all */
if ((vv->video_status & STATUS_OVERLAY) == 0) {
- DEB_D(("no active streaming capture.\n"));
+ DEB_D(("no active overlay.\n"));
return 0;
}
if (vv->video_fh != fh) {
- DEB_D(("streaming capture is active, but in another open.\n"));
+ DEB_D(("overlay is active, but in another open.\n"));
return -EBUSY;
}
@@ -908,12 +908,10 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
struct saa7146_format *fmt;
DEB_EE(("VIDIOC_S_FBUF\n"));
-/*
- if(!capable(CAP_SYS_ADMIN)) { // && !capable(CAP_SYS_RAWIO)) {
- DEB_D(("VIDIOC_S_FBUF: not CAP_SYS_ADMIN or CAP_SYS_RAWIO.\n"));
+
+ if(!capable(CAP_SYS_ADMIN) &&
+ !capable(CAP_SYS_RAWIO))
return -EPERM;
- }
-*/
/* check args */
fmt = format_by_fourcc(dev,fb->fmt.pixelformat);
@@ -925,14 +923,17 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int
if (0 != (fmt->flags & FORMAT_IS_PLANAR)) {
DEB_S(("planar pixelformat '%4.4s' not allowed for overlay\n",(char *)&fmt->pixelformat));
}
-
- down(&dev->lock);
- if (vv->video_status != 0) {
- DEB_S(("overlay video is active\n"));
- up(&dev->lock);
- return -EBUSY;
+
+ /* check if overlay is running */
+ if (IS_OVERLAY_ACTIVE(fh) != 0) {
+ if (vv->video_fh != fh) {
+ DEB_D(("refusing to change framebuffer informations while overlay is active in another open.\n"));
+ return -EBUSY;
+ }
}
+ down(&dev->lock);
+
/* ok, accept it */
vv->ov_fb = *fb;
vv->ov_fmt = fmt;