From 781f294654f0e05f036f3f8af752140170ec3795 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 6 Nov 2016 10:19:37 +0200 Subject: [PATCH] Helper: write recording only if needed --- src/bin/exactness_helper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness_helper.c b/src/bin/exactness_helper.c index 0cf4b21..fa0b284 100644 --- a/src/bin/exactness_helper.c +++ b/src/bin/exactness_helper.c @@ -153,6 +153,7 @@ main(int argc, char *argv[]) const char *rec_file = NULL, *comp1 = NULL, *comp2 = NULL; int ret = 0, args = 0; unsigned short delay = 0; + Eina_Bool write_file = EINA_FALSE; Eina_Bool want_quit, clean = EINA_FALSE, list_get = EINA_FALSE, compare_files = EINA_FALSE; Ecore_Getopt_Value values[] = { ECORE_GETOPT_VALUE_USHORT(delay), @@ -228,6 +229,7 @@ main(int argc, char *argv[]) { list->first_timestamp = evt_time_get(0, eina_list_data_get(list->variant_list)); } + write_file = EINA_TRUE; } if (delay) @@ -239,6 +241,7 @@ main(int argc, char *argv[]) list->first_timestamp = evt_time_get(0, eina_list_data_get(list->variant_list)); } list->first_timestamp -= delay; + write_file = EINA_TRUE; } if (list_get) @@ -291,7 +294,7 @@ main(int argc, char *argv[]) } } - if (rec_file) write_events(rec_file, list); + if (rec_file && write_file) write_events(rec_file, list); end: ecore_shutdown();