Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118715
b: refs/heads/master
c: 9c8e0a2
h: refs/heads/master
i:
  118713: 2eb8881
  118711: 0c725c7
v: v3
  • Loading branch information
Frederic CAND authored and Mauro Carvalho Chehab committed Nov 11, 2008
1 parent 70c28b8 commit f218fec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2482377c9df89daa0cb94252bd1e8829c0e9c2f
refs/heads/master: 9c8e0a260ed7c8935d7ee8dd51cd1971ef516385
8 changes: 6 additions & 2 deletions trunk/drivers/media/video/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,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();
Expand Down Expand Up @@ -1109,6 +1109,8 @@ static int mpeg_open(struct inode *inode, struct file *file)
fh->mpegq.field);
unlock_kernel();

atomic_inc(&dev->core->mpeg_users);

return 0;
}

Expand All @@ -1118,7 +1120,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);
Expand All @@ -1138,6 +1140,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;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/cx88/cx88.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,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;
Expand Down

0 comments on commit f218fec

Please sign in to comment.