From: Jaroslav Kysela Date: Tue, 19 Dec 2017 14:06:22 +0000 (+0100) Subject: capmt: the enigma2-like descriptors have limit for 8 adapters, use pc-type descriptor... X-Git-Tag: v4.2.6~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d102d709da429cb9c9ec2e8795c3b4412cbced1;p=thirdparty%2Ftvheadend.git capmt: the enigma2-like descriptors have limit for 8 adapters, use pc-type descriptors for adapters 8+, issue #4793 --- diff --git a/src/descrambler/capmt.c b/src/descrambler/capmt.c index d6bd47635..0bf39587b 100644 --- a/src/descrambler/capmt.c +++ b/src/descrambler/capmt.c @@ -2019,7 +2019,9 @@ capmt_send_request(capmt_service_t *ct, int lm) uint16_t pmtpid = t->s_pmt_pid; uint16_t transponder = t->s_dvb_mux->mm_tsid; uint16_t onid = t->s_dvb_mux->mm_onid; - int adapter_num = ct->ct_adapter; + const int adapter_num = ct->ct_adapter; + const int wrapper = capmt->capmt_oscam == CAPMT_OSCAM_SO_WRAPPER; + const int pc_desc = !wrapper && adapter_num >= 8; /* buffer for capmt */ int pos = 0, pos2; @@ -2041,6 +2043,14 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = 1; /* OK DESCRAMBLING, skipped for parse_descriptors, but */ /* mandatory for getDemuxOptions() */ + if (pc_desc) { + /* 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; @@ -2054,10 +2064,12 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = onid; /* 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; + if (wrapper || !pc_desc) { + buf[pos++] = CAPMT_DESC_DEMUX; + buf[pos++] = 2; + buf[pos++] = 1 << adapter_num; + buf[pos++] = wrapper ? adapter_num : 0; + } /* build SI tag */ buf[pos++] = CAPMT_DESC_PID; @@ -2065,7 +2077,7 @@ capmt_send_request(capmt_service_t *ct, int lm) buf[pos++] = pmtpid >> 8; buf[pos++] = pmtpid; - if (capmt->capmt_oscam != CAPMT_OSCAM_SO_WRAPPER) { + if (!wrapper && !pc_desc) { /* build SI tag */ buf[pos++] = CAPMT_DESC_ADAPTER; buf[pos++] = 1;