validate:ssim: Let user know when no file have been compared

Fixing a possible division by zero issue.

CID 1415482
This commit is contained in:
Thibault Saunier 2017-07-18 10:19:23 -04:00
parent 28f8787c17
commit 566adba269

View file

@ -800,9 +800,13 @@ _check_directory (GstValidateSsim * self, const gchar * ref_dir,
g_object_unref (info);
}
gst_validate_printf (NULL,
"\nAverage similarity: %f, min_avg: %f, min_min: %f\n",
total_avg / nfiles, min_avg, min_min);
if (nfiles == 0) {
gst_validate_printf (NULL, "\nNo files to verify.\n");
} else {
gst_validate_printf (NULL,
"\nAverage similarity: %f, min_avg: %f, min_min: %f\n",
total_avg / nfiles, min_avg, min_min);
}
done:
gst_object_unref (file);