From c1c22934309717df6699743c8c06f0ce263d6326 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 14 Dec 2017 21:28:22 +0100 Subject: [PATCH] descrambler: capmt - follow enigma2 way to build the capmt descriptor, issue #4793 --- src/descrambler/capmt.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index b7a930d80..d6bd47635 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -99,6 +99,7 @@ typedef struct dmx_filter { // ca_pmt_descriptor types #define CAPMT_DESC_ENIGMA 0x81 #define CAPMT_DESC_DEMUX 0x82 +#define CAPMT_DESC_ADAPTER 0x83 #define CAPMT_DESC_PID 0x84 // message type @@ -2040,16 +2041,6 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = 1; /* OK DESCRAMBLING, skipped for parse_descriptors, but */ /* mandatory for getDemuxOptions() */ - /* build program info tags */ - - if (capmt->capmt_oscam != CAPMT_OSCAM_SO_WRAPPER) { - /* build SI tag */ - buf[pos++] = CAPMT_DESC_DEMUX; - buf[pos++] = 2; - buf[pos++] = 0; - buf[pos++] = adapter_num; - } - /* build SI tag */ buf[pos++] = CAPMT_DESC_ENIGMA; buf[pos++] = 8; @@ -2062,13 +2053,11 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = onid >> 8; buf[pos++] = onid; - if (capmt->capmt_oscam == CAPMT_OSCAM_SO_WRAPPER) { - /* build SI tag */ - buf[pos++] = CAPMT_DESC_DEMUX; - buf[pos++] = 2; - buf[pos++] = 1 << adapter_num; - buf[pos++] = adapter_num; - } + /* build SI tag */ + buf[pos++] = CAPMT_DESC_DEMUX; + buf[pos++] = 2; + buf[pos++] = 1 << adapter_num; + buf[pos++] = capmt->capmt_oscam == CAPMT_OSCAM_SO_WRAPPER ? adapter_num : 0; /* build SI tag */ buf[pos++] = CAPMT_DESC_PID; @@ -2076,6 +2065,13 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = pmtpid >> 8; buf[pos++] = pmtpid; + if (capmt->capmt_oscam != CAPMT_OSCAM_SO_WRAPPER) { + /* build SI tag */ + buf[pos++] = CAPMT_DESC_ADAPTER; + buf[pos++] = 1; + buf[pos++] = adapter_num; + } + capmt_caid_ecm_t *cce2; LIST_FOREACH(cce2, &ct->ct_caid_ecm, cce_link) { /* build SI tag */ -- 2.47.3