diff options
author | darron@kewl.org <darron@kewl.org> | 2008-10-30 07:50:05 +0000 |
---|---|---|
committer | darron@kewl.org <darron@kewl.org> | 2008-10-30 07:50:05 +0000 |
commit | e6404f328c9bf8ea423b3e78078dcba7fec4fcb8 (patch) | |
tree | 6ee5c82ba95f67b01240afd505e5b166f9c40381 /linux/drivers/media/video/cx88 | |
parent | 03fa826b897d7f40fcdd50ee7b76a3077ea949c1 (diff) | |
download | mediapointer-dvb-s2-e6404f328c9bf8ea423b3e78078dcba7fec4fcb8.tar.gz mediapointer-dvb-s2-e6404f328c9bf8ea423b3e78078dcba7fec4fcb8.tar.bz2 |
cx88-blackbird: bugfix: cx88-blackbird-mpeg-users
From: Frederic CAND <frederic.cand@anevia.com>
Allows multiple access to the mpeg device
Signed-off-by: Frederic CAND <frederic.cand@anevia.com>
Diffstat (limited to 'linux/drivers/media/video/cx88')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-blackbird.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index eca841bef..3d2afe195 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -1097,7 +1097,7 @@ static int mpeg_open(struct inode *inode, struct file *file) } } - if (blackbird_initialize_codec(dev) < 0) { + if (!atomic_read(&dev->core->mpeg_users) && blackbird_initialize_codec(dev) < 0) { if (drv) drv->request_release(drv); unlock_kernel(); @@ -1128,6 +1128,8 @@ static int mpeg_open(struct inode *inode, struct file *file) fh->mpegq.field); unlock_kernel(); + atomic_inc(&dev->core->mpeg_users); + return 0; } @@ -1137,7 +1139,7 @@ static int mpeg_release(struct inode *inode, struct file *file) struct cx8802_dev *dev = fh->dev; struct cx8802_driver *drv = NULL; - if (dev->mpeg_active) + if (dev->mpeg_active && atomic_read(&dev->core->mpeg_users) == 1) blackbird_stop_codec(dev); cx8802_cancel_buffers(fh->dev); @@ -1157,6 +1159,8 @@ static int mpeg_release(struct inode *inode, struct file *file) if (drv) drv->request_release(drv); + atomic_dec(&dev->core->mpeg_users); + return 0; } diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 0fc7c91f7..164e3453d 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -356,6 +356,7 @@ struct cx88_core { /* various v4l controls */ u32 freq; atomic_t users; + atomic_t mpeg_users; /* cx88-video needs to access cx8802 for hybrid tuner pll access. */ struct cx8802_dev *dvbdev; |