Fix mmap access of transport stream from saa7134
PATCH 1/1 Fix mmap access of transport stream from saa7134
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 =====
drivers/media/video/saa7134/saa7134-ts.c +2 -8
@@ -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 ); }
Signature · 2 lines
Måns Rullgård [email protected]