moved FPS indicator prefix trailing ' ' trim

moved to video_capture.cpp  - it is a bit technical and it is nicer to
have it there than in the huge main.cpp
This commit is contained in:
Martin Pulec
2024-05-15 08:28:40 +02:00
parent d0bfef4651
commit ade96e561d
3 changed files with 22 additions and 8 deletions

View File

@@ -318,10 +318,8 @@ static void *capture_thread(void *arg)
struct wait_obj *wait_obj = wait_obj_init();
steady_clock::time_point t0 = steady_clock::now();
int frames = 0;
char *print_fps_prefix = vidcap_get_fps_print_prefix(uv->capture_device) ? strdupa(vidcap_get_fps_print_prefix(uv->capture_device)) : NULL;
if (print_fps_prefix && print_fps_prefix[strlen(print_fps_prefix) - 1] == ' ') { // trim trailing ' '
print_fps_prefix[strlen(print_fps_prefix) - 1] = '\0';
}
const char *print_fps_prefix =
vidcap_get_fps_print_prefix(uv->capture_device);
while (!uv->should_exit_capture) {
/* Capture and transmit video... */