Move FPS counter start/stop logs

This will allow to print the same logs for every start/stop call.

PR #3030 <https://github.com/Genymobile/scrcpy/pull/3030>
This commit is contained in:
Romain Vimont 2022-02-17 20:10:09 +01:00
parent 03705b828b
commit fa93c8a91b
2 changed files with 4 additions and 6 deletions

View file

@ -117,6 +117,7 @@ sc_fps_counter_start(struct sc_fps_counter *counter) {
counter->thread_started = true; counter->thread_started = true;
} }
LOGI("FPS counter started");
return true; return true;
} }
@ -124,6 +125,7 @@ void
sc_fps_counter_stop(struct sc_fps_counter *counter) { sc_fps_counter_stop(struct sc_fps_counter *counter) {
set_started(counter, false); set_started(counter, false);
sc_cond_signal(&counter->state_cond); sc_cond_signal(&counter->state_cond);
LOGI("FPS counter stopped");
} }
bool bool

View file

@ -247,13 +247,9 @@ switch_fps_counter_state(struct sc_fps_counter *fps_counter) {
// is no ToCToU issue // is no ToCToU issue
if (sc_fps_counter_is_started(fps_counter)) { if (sc_fps_counter_is_started(fps_counter)) {
sc_fps_counter_stop(fps_counter); sc_fps_counter_stop(fps_counter);
LOGI("FPS counter stopped");
} else { } else {
if (sc_fps_counter_start(fps_counter)) { sc_fps_counter_start(fps_counter);
LOGI("FPS counter started"); // Any error is already logged
} else {
LOGE("FPS counter starting failed");
}
} }
} }