Skip to content

Commit

Permalink
Move FPS counter start/stop logs
Browse files Browse the repository at this point in the history
This will allow to print the same logs for every start/stop call.

PR #3030 <#3030>
  • Loading branch information
rom1v committed Feb 18, 2022
1 parent 03705b8 commit fa93c8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 2 additions & 0 deletions app/src/fps_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,15 @@ sc_fps_counter_start(struct sc_fps_counter *counter) {
counter->thread_started = true;
}

LOGI("FPS counter started");
return true;
}

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
Expand Down
8 changes: 2 additions & 6 deletions app/src/input_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit fa93c8a

Please sign in to comment.