aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-21 14:39:51 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-21 14:39:51 (GMT)
commit3a0c6de8abe7f4470a16ea17c8185b4206fffa75 (patch)
tree3691a8e48e9abc966ef8b22897dd6135e6ba1c50
parentfc3e6bc8bc8c039cdcb7f864ed85fe44843965e0 (diff)
Reset frame counters when the camera changes
Different cameras may have different frame rates. Reset the values when a camera is changed, as it doesn't make sense to keep using the values from the previous one. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--src/callbacks.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 1191ddc..d8e31fc 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -1134,6 +1134,11 @@ void start_camera(cam_t *cam)
cam->tmp = NULL;
}
+ /* Reset also frame counts, as the new camera can use a different fps */
+ frames = 0;
+ frames2 = 0;
+ seconds = 0;
+
/* Second step: clean-up all resolutions */
container = GTK_WIDGET(gtk_builder_get_object(cam->xml, "menuitem4_menu"));

Privacy Policy