From fa8011b4667df787c4d6c6acfa443dd68d0f13ea Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 23:05:43 +0000 Subject: [PATCH] Support new OSCam version format in CAPMT descrambler (#2017) --- src/descrambler/capmt.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index f37a0c22a..0d904123d 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "tvheadend.h" @@ -1513,8 +1514,16 @@ capmt_analyze_cmd(capmt_t *capmt, uint32_t cmd, int adapter, sbuf_t *sb, int off char *rev = strstr(info, "build r"); tvhinfo(LS_CAPMT, "%s: Connected to server '%s' (protocol version %d)", capmt_name(capmt), info, protover); - if (rev) + if (rev) { + /* Old format: "OSCam v1.30, build r11772@631abab8" */ capmt->capmt_oscam_rev = strtol(rev + 7, NULL, 10); + } else if (strncmp(info, "OSCam ", 6) == 0) { + /* New format: "OSCam 2.25.11-11905" - revision after last hyphen */ + char *last_hyphen = strrchr(info, '-'); + if (last_hyphen && isdigit(last_hyphen[1])) { + capmt->capmt_oscam_rev = strtol(last_hyphen + 1, NULL, 10); + } + } free(info); -- 2.47.3