From e7b5ac7c73cfd316cf36d339952de7878e217aa6 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 10 Oct 2025 10:23:18 +0200 Subject: [PATCH 1/2] [core,timer] fix reschedule interval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit time was calculated in µs instead of ms. @vokov0aa thank you for the hint --- libfreerdp/core/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfreerdp/core/timer.c b/libfreerdp/core/timer.c index 1153d8b0a..543c35447 100644 --- a/libfreerdp/core/timer.c +++ b/libfreerdp/core/timer.c @@ -217,7 +217,7 @@ static DWORD WINAPI timer_thread(LPVOID arg) } const uint64_t diff = next - now; - const uint64_t diffMS = diff / 1000; + const uint64_t diffMS = diff / 1000000ull; timeout = INFINITE; if (diffMS < INFINITE) timeout = (uint32_t)diffMS; From 14f065617c9139de95cc3157e6f92767e26c6582 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 10 Oct 2025 17:39:46 +0200 Subject: [PATCH 2/2] [timer] fix too short interval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with migrating to freerdp_timer_add the timer values should have been adjusted to be in ns instead of µs --- channels/video/client/video_main.c | 2 +- client/Wayland/wlf_disp.c | 2 +- client/X11/xf_disp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/channels/video/client/video_main.c b/channels/video/client/video_main.c index f02772418..dba7063bf 100644 --- a/channels/video/client/video_main.c +++ b/channels/video/client/video_main.c @@ -1160,7 +1160,7 @@ static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManage if (status == CHANNEL_RC_OK) video->context->priv->timerID = - freerdp_timer_add(video->rdpcontext, 20000, timer_cb, video->context, true); + freerdp_timer_add(video->rdpcontext, 20000000, timer_cb, video->context, true); video->initialized = video->context->priv->timerID != 0; if (!video->initialized) status = ERROR_INTERNAL_ERROR; diff --git a/client/Wayland/wlf_disp.c b/client/Wayland/wlf_disp.c index df5e5c218..cdeb8bad3 100644 --- a/client/Wayland/wlf_disp.c +++ b/client/Wayland/wlf_disp.c @@ -27,7 +27,7 @@ #define TAG CLIENT_TAG("wayland.disp") -#define RESIZE_MIN_DELAY_NS 200000UL /* minimum delay in ns between two resizes */ +#define RESIZE_MIN_DELAY_NS 200000000UL /* minimum delay in ns between two resizes */ struct s_wlfDispContext { diff --git a/client/X11/xf_disp.c b/client/X11/xf_disp.c index 2022cce64..045a649d7 100644 --- a/client/X11/xf_disp.c +++ b/client/X11/xf_disp.c @@ -40,7 +40,7 @@ #include #define TAG CLIENT_TAG("x11disp") -#define RESIZE_MIN_DELAY_NS 200000UL /* minimum delay in ms between two resizes */ +#define RESIZE_MIN_DELAY_NS 200000000UL /* minimum delay in ms between two resizes */ struct s_xfDispContext {