From dff7346d93620339a65fcf2dd8f94ead9ef20e43 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Sun, 5 Jan 2003 18:42:20 +0000 Subject: Fixed a saa7146 driver flaw: after a read() call is satisfied, a previoulsy running overlay window should be re-enabled. --- linux/drivers/media/common/saa7146_video.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'linux/drivers') diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index 8a2d83c98..c5dfca244 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -1303,8 +1303,17 @@ ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) struct saa7146_vv *vv = dev->vv_data; ssize_t ret = 0; + int restart_overlay = 0; + struct saa7146_fh *ov_fh = NULL; + DEB_EE(("called.\n")); + if( vv->ov_data != NULL ) { + ov_fh = vv->ov_data->fh; + stop_preview(ov_fh); + restart_overlay = 1; + } + if( 0 != video_begin(fh)) { return -EAGAIN; } @@ -1312,8 +1321,8 @@ ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) video_end(fh); /* restart overlay if it was active before */ - if( 0 != vv->ov_data) { - start_preview(vv->ov_data->fh); + if( 0 != restart_overlay ) { + start_preview(ov_fh); } return ret; -- cgit v1.2.3