From fa93c8a91b6ea6ce82e61b05c0c3b96da9c589c7 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 17 Feb 2022 20:10:09 +0100 Subject: [PATCH] Move FPS counter start/stop logs This will allow to print the same logs for every start/stop call. PR #3030 --- app/src/fps_counter.c | 2 ++ app/src/input_manager.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/fps_counter.c b/app/src/fps_counter.c index 41ffeaaf..85312821 100644 --- a/app/src/fps_counter.c +++ b/app/src/fps_counter.c @@ -117,6 +117,7 @@ sc_fps_counter_start(struct sc_fps_counter *counter) { counter->thread_started = true; } + LOGI("FPS counter started"); return true; } @@ -124,6 +125,7 @@ void sc_fps_counter_stop(struct sc_fps_counter *counter) { set_started(counter, false); sc_cond_signal(&counter->state_cond); + LOGI("FPS counter stopped"); } bool diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 89ac450d..bba3665c 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -247,13 +247,9 @@ switch_fps_counter_state(struct sc_fps_counter *fps_counter) { // is no ToCToU issue if (sc_fps_counter_is_started(fps_counter)) { sc_fps_counter_stop(fps_counter); - LOGI("FPS counter stopped"); } else { - if (sc_fps_counter_start(fps_counter)) { - LOGI("FPS counter started"); - } else { - LOGE("FPS counter starting failed"); - } + sc_fps_counter_start(fps_counter); + // Any error is already logged } }