From 1a3582c8770ccb383ad9b29bffe54c4b8c625a48 Mon Sep 17 00:00:00 2001 From: Siyuan Date: Fri, 21 Nov 2025 12:03:01 +0000 Subject: [PATCH] fix: update process title when video state changes --- internal/native/cgo/video.c | 12 ++++++------ internal/native/server.go | 6 ++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/native/cgo/video.c b/internal/native/cgo/video.c index e9d69440..e0f550fa 100644 --- a/internal/native/cgo/video.c +++ b/internal/native/cgo/video.c @@ -373,6 +373,8 @@ void set_streaming_flag(bool flag) pthread_mutex_lock(&streaming_mutex); streaming_flag = flag; pthread_mutex_unlock(&streaming_mutex); + + video_send_format_report(); } void set_streaming_stopped(bool stopped) @@ -380,6 +382,8 @@ void set_streaming_stopped(bool stopped) pthread_mutex_lock(&streaming_stopped_mutex); streaming_stopped = stopped; pthread_mutex_unlock(&streaming_stopped_mutex); + + video_send_format_report(); } bool get_streaming_stopped() @@ -545,6 +549,8 @@ void *run_video_stream(void *arg) uint32_t num = 0; VIDEO_FRAME_INFO_S stFrame; + + while (streaming_flag) { FD_ZERO(&fds); @@ -654,8 +660,6 @@ void *run_video_stream(void *arg) set_streaming_stopped(true); - video_send_format_report(); - return NULL; } @@ -718,8 +722,6 @@ void video_start_streaming() // Only set streaming_thread after successful creation streaming_thread = new_thread; - - video_send_format_report(); } bool wait_for_streaming_stopped() @@ -755,8 +757,6 @@ void video_stop_streaming() streaming_thread = NULL; log_info("video streaming stopped"); - - video_send_format_report(); } uint8_t video_get_streaming_status() { diff --git a/internal/native/server.go b/internal/native/server.go index 7fa6c987..62c2a74f 100644 --- a/internal/native/server.go +++ b/internal/native/server.go @@ -59,8 +59,10 @@ func updateProcessTitle(state *VideoState) { procPrefix = "jetkvm: [native]" } else { status := "active" - if !state.Ready { - status = "starting" + if state.Streaming == VideoStreamingStatusInactive { + status = "inactive" + } else if !state.Ready { + status = "not ready" } else if state.Error != "" { status = state.Error } else {