From 25f8f82384b5f5f03d711d620e342af8cc4746ad Mon Sep 17 00:00:00 2001 From: Dylan Corrales Date: Sun, 8 Nov 2026 12:33:47 -0500 Subject: [PATCH] Letting an empty text clear an overlay region doc/overlays.md says an empty string clears a region (/api/osd/1?text=), but the /api/osd query loop skips every key with an empty value, so text= did nothing: the region kept its text, the API went on reporting it, and it stayed on the stream until Divinus restarted. An empty text is now accepted and clears the text, which lets the region thread's existing removal path run; every other key still needs a value. The web page's Apply sends text= for an emptied field, so it clears the region too. Tested on an Ambarella S3L camera (HAL not upstream yet), H.264 over RTSP: text=OSDTEST drawn, text= removes it (the API reports ""), new text draws again, the web page's full query with text= and other empty fields removes it, and a $t time region is removed the same way. --- src/server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index 0b113a98..c50af083 100644 --- a/src/server.c +++ b/src/server.c @@ -1400,7 +1400,9 @@ void respond_request(http_request_t *req) { if (!value || !*value) continue; unescape_uri(value); char *key = split(&value, "="); - if (!key || !*key || !value || !*value) continue; + if (!key || !*key || !value) continue; + // An empty text removes the region's text; every other key needs a value + if (!*value && !EQUALS(key, "text")) continue; if (EQUALS(key, "img")) strncpy(osds[id].img, value, sizeof(osds[id].img) - 1);