From 7a803e2fd80a62566a67d9e5930f9eafd97b0eb6 Mon Sep 17 00:00:00 2001 From: Sergey Prokhorov Date: Wed, 6 Nov 2024 23:59:45 +0100 Subject: [PATCH] Fix video being extremely slow when OSD is disabled via command line --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 98b0f5a..7afa525 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -291,12 +291,14 @@ void *__DISPLAY_THREAD__(void *param) ret = pthread_mutex_lock(&osd_mutex); assert(!ret); - ret = set_drm_object_property(output_list->video_request, &output_list->osd_plane, "FB_ID", output_list->osd_bufs[output_list->osd_buf_switch].fb); - assert(ret>0); + if(enable_osd) { + ret = set_drm_object_property(output_list->video_request, &output_list->osd_plane, "FB_ID", output_list->osd_bufs[output_list->osd_buf_switch].fb); + assert(ret>0); + } drmModeAtomicCommit(drm_fd, output_list->video_request, DRM_MODE_ATOMIC_NONBLOCK, NULL); ret = pthread_mutex_unlock(&osd_mutex); - assert(!ret); + frame_counter++; osd_publish_uint_fact("video.displayed_frame", NULL, 0, 1);