mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
examples: gst-camerabin2-test: protect from division by zero
Highly unlikely to have 0 captures, but protect from crashes in the future by doing none of the math if there is no data.
This commit is contained in:
parent
acf0d92d0f
commit
16f61e7b2d
1 changed files with 4 additions and 2 deletions
|
@ -723,8 +723,7 @@ setup_pipeline (void)
|
|||
if (ipp) {
|
||||
g_object_set (camerabin, "image-filter", ipp, NULL);
|
||||
g_object_unref (ipp);
|
||||
}
|
||||
else
|
||||
} else
|
||||
GST_WARNING ("Could not create ipp elements");
|
||||
}
|
||||
|
||||
|
@ -1077,6 +1076,9 @@ print_performance_data (void)
|
|||
i++;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return;
|
||||
|
||||
if (i > 1)
|
||||
shot_to_shot = avg.shot_to_shot / (i - 1);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue