This patch fixes mmap access of transport stream from saa7134/saa6752hs.
It causes the encoder to be initialized when the device is opened,
instead of on the first call to read().
The patch is against 2.6.9.
Signed-off-by: M?ns Rullg?rd <[email protected]>
===== drivers/media/video/saa7134/saa7134-ts.c 1.13 vs edited =====
--- 1.13/drivers/media/video/saa7134/saa7134-ts.c 2004-07-12 10:01:15 +02:00
+++ edited/drivers/media/video/saa7134/saa7134-ts.c 2004-10-20 17:02:08 +02:00
@@ -211,10 +211,10 @@
if (dev->ts.users)
goto done;
- dev->ts.started = 0;
dev->ts.users++;
file->private_data = dev;
err = 0;
+ ts_init_encoder(dev, NULL);
done:
up(&dev->ts.ts.lock);
@@ -233,8 +233,7 @@
dev->ts.users--;
/* stop the encoder */
- if (dev->ts.started)
- ts_reset_encoder(dev);
+ ts_reset_encoder(dev);
up(&dev->ts.ts.lock);
return 0;
@@ -245,11 +244,6 @@
{
struct saa7134_dev *dev = file->private_data;
- if (!dev->ts.started) {
- ts_init_encoder(dev, NULL);
- dev->ts.started = 1;
- }
-
return videobuf_read_stream(file, &dev->ts.ts, data, count, ppos, 0);
}
--
M?ns Rullg?rd
[email protected]