]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Support new OSCam version format in CAPMT descrambler (#2017)
authorCopilot <198982749+Copilot@users.noreply.github.com>
Mon, 22 Dec 2025 23:05:43 +0000 (23:05 +0000)
committerGitHub <noreply@github.com>
Mon, 22 Dec 2025 23:05:43 +0000 (23:05 +0000)
src/descrambler/capmt.c

index f37a0c22ab9a4d360d2212188cfe19d5375e228d..0d904123d1e766be3ba5d925897916c5bc7e5d61 100644 (file)
@@ -20,6 +20,7 @@
 #include <arpa/inet.h>
 #include <sys/un.h>
 #include <fcntl.h>
+#include <ctype.h>
 
 #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);