Skip to content

Commit

Permalink
Incorrect FPS value when WebcamPanel used with non-blocking mode, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jul 5, 2013
1 parent 2e2c6d1 commit 65f7873
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ public void run() {
long delta = t2 - t1 + 1; // +1 to avoid division by zero
long delay = Math.max((1000 / TARGET_FPS) - delta, 0);

fps = (4 * fps + 1000 / delta) / 5;
if (device instanceof WebcamDevice.FPSSource) {
fps = ((WebcamDevice.FPSSource) device).getFPS();
} else {
fps = (4 * fps + 1000 / delta) / 5;
}

// reschedule task

Expand Down

0 comments on commit 65f7873

Please sign in to comment.