Commit 76fafe78 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[media] gspca_cpia1: Don't allow the framerate divisor to go above 2

Having a framerate divisor of 3 is not really necesarry and leads to
various troubles (frames going missing, compression issues) when allowed.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 49b61ec9
/* /*
* cpia CPiA (1) gspca driver * cpia CPiA (1) gspca driver
* *
* Copyright (C) 2010 Hans de Goede <hdegoede@redhat.com> * Copyright (C) 2010-2011 Hans de Goede <hdegoede@redhat.com>
* *
* This module is adapted from the in kernel v4l1 cpia driver which is : * This module is adapted from the in kernel v4l1 cpia driver which is :
* *
...@@ -1400,7 +1400,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev) ...@@ -1400,7 +1400,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
if ((sd->exposure_status == EXPOSURE_VERY_DARK || if ((sd->exposure_status == EXPOSURE_VERY_DARK ||
sd->exposure_status == EXPOSURE_DARK) && sd->exposure_status == EXPOSURE_DARK) &&
sd->exposure_count >= DARK_TIME * framerate && sd->exposure_count >= DARK_TIME * framerate &&
sd->params.sensorFps.divisor < 3) { sd->params.sensorFps.divisor < 2) {
/* dark for too long */ /* dark for too long */
++sd->params.sensorFps.divisor; ++sd->params.sensorFps.divisor;
...@@ -1456,7 +1456,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev) ...@@ -1456,7 +1456,7 @@ static void monitor_exposure(struct gspca_dev *gspca_dev)
if ((sd->exposure_status == EXPOSURE_VERY_DARK || if ((sd->exposure_status == EXPOSURE_VERY_DARK ||
sd->exposure_status == EXPOSURE_DARK) && sd->exposure_status == EXPOSURE_DARK) &&
sd->exposure_count >= DARK_TIME * framerate && sd->exposure_count >= DARK_TIME * framerate &&
sd->params.sensorFps.divisor < 3) { sd->params.sensorFps.divisor < 2) {
/* dark for too long */ /* dark for too long */
++sd->params.sensorFps.divisor; ++sd->params.sensorFps.divisor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment