Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109592
b: refs/heads/master
c: bf2a220
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Sep 4, 2008
1 parent 87c4fe8 commit f8d4f1d
Show file tree
Hide file tree
Showing 2 changed files with 13 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: a94a508691d16420ad10572a33db4d45115b5f75
refs/heads/master: bf2a2202f75cda679303f09d150f9549f9835953
14 changes: 12 additions & 2 deletions trunk/drivers/media/video/gspca/sonixb.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ MODULE_LICENSE("GPL");
struct sd {
struct gspca_dev gspca_dev; /* !! must be the first item */
atomic_t avg_lum;
int prev_avg_lum;

unsigned char gain;
unsigned char exposure;
Expand Down Expand Up @@ -1022,10 +1023,19 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
} else {
lum = data[i + 8] + (data[i + 9] << 8);
}
if (lum == 0) {
/* When exposure changes midway a frame we
get a lum of 0 in this case drop 2 frames
as the frames directly after an exposure
change have an unstable image. Sometimes lum
*really* is 0 (cam used in low light with
low exposure setting), so do not drop frames
if the previous lum was 0 too. */
if (lum == 0 && sd->prev_avg_lum != 0) {
lum = -1;
sd->frames_to_drop = 2;
}
sd->prev_avg_lum = 0;
} else
sd->prev_avg_lum = lum;
atomic_set(&sd->avg_lum, lum);

if (sd->frames_to_drop) {
Expand Down

0 comments on commit f8d4f1d

Please sign in to comment.