Last active
September 12, 2018 05:12
-
-
Save athoik/8aefccbbcf902703056659a0a2c48b28 to your computer and use it in GitHub Desktop.
Patch to support the new DTV_SCRAMBLING_SEQUENCE_INDEX on enigma2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp | |
index 96f52b5..30918be 100644 | |
--- a/lib/dvb/frontend.cpp | |
+++ b/lib/dvb/frontend.cpp | |
@@ -1420,6 +1420,7 @@ void eDVBFrontend::getTransponderData(ePtr<iDVBTransponderData> &dest, bool orig | |
p[cmdseq.num++].cmd = DTV_FREQUENCY; | |
p[cmdseq.num++].cmd = DTV_INVERSION; | |
p[cmdseq.num++].cmd = DTV_MODULATION; | |
+ p[cmdseq.num++].cmd = DTV_API_VERSION; | |
if (type == feSatellite) | |
{ | |
p[cmdseq.num++].cmd = DTV_SYMBOL_RATE; | |
@@ -1427,6 +1428,10 @@ void eDVBFrontend::getTransponderData(ePtr<iDVBTransponderData> &dest, bool orig | |
p[cmdseq.num++].cmd = DTV_ROLLOFF; | |
p[cmdseq.num++].cmd = DTV_PILOT; | |
p[cmdseq.num++].cmd = DTV_STREAM_ID; | |
+ if (m_dvbversion >= DVB_VERSION(5, 11)) | |
+ { | |
+ p[cmdseq.num++].cmd = DTV_SCRAMBLING_SEQUENCE_INDEX; | |
+ } | |
} | |
else if (type == feCable) | |
{ | |
@@ -2051,7 +2056,15 @@ void eDVBFrontend::setFrontend(bool recvEvents) | |
{ | |
p[cmdseq.num].cmd = DTV_ROLLOFF, p[cmdseq.num].u.data = rolloff, cmdseq.num++; | |
p[cmdseq.num].cmd = DTV_PILOT, p[cmdseq.num].u.data = pilot, cmdseq.num++; | |
- p[cmdseq.num].cmd = DTV_STREAM_ID, p[cmdseq.num].u.data = parm.is_id | (parm.pls_code << 8) | (parm.pls_mode << 26), cmdseq.num++; | |
+ if (m_dvbversion >= DVB_VERSION(5, 11)) | |
+ { | |
+ p[cmdseq.num].cmd = DTV_STREAM_ID, p[cmdseq.num].u.data = parm.is_id, cmdseq.num++; | |
+ p[cmdseq.num].cmd = DTV_SCRAMBLING_SEQUENCE_INDEX, p[cmdseq.num].u.data = parm.pls_code, cmdseq.num++; | |
+ } | |
+ else | |
+ { | |
+ p[cmdseq.num].cmd = DTV_STREAM_ID, p[cmdseq.num].u.data = parm.is_id | (parm.pls_code << 8) | (parm.pls_mode << 26), cmdseq.num++; | |
+ } | |
} | |
} | |
else if (type == iDVBFrontend::feCable) | |
diff --git a/lib/dvb/frontend.h b/lib/dvb/frontend.h | |
index 36ebcf0..46228c1 100644 | |
--- a/lib/dvb/frontend.h | |
+++ b/lib/dvb/frontend.h | |
@@ -1,6 +1,10 @@ | |
#ifndef __dvb_frontend_h | |
#define __dvb_frontend_h | |
+#ifndef DTV_SCRAMBLING_SEQUENCE_INDEX | |
+#define DTV_SCRAMBLING_SEQUENCE_INDEX 70 | |
+#endif | |
+ | |
#include <map> | |
#include <lib/dvb/idvb.h> | |
#include <lib/dvb/frontendparms.h> | |
diff --git a/lib/dvb/frontendparms.cpp b/lib/dvb/frontendparms.cpp | |
index fc86a20..20527cc 100644 | |
--- a/lib/dvb/frontendparms.cpp | |
+++ b/lib/dvb/frontendparms.cpp | |
@@ -350,6 +350,9 @@ int eDVBSatelliteTransponderData::getPLSMode() const | |
{ | |
if (originalValues) return transponderParameters.pls_mode; | |
+ if (getProperty(DTV_API_VERSION) >= DVB_VERSION(5, 11)) | |
+ return eDVBFrontendParametersSatellite::PLS_Gold; | |
+ | |
unsigned int stream_id = getProperty(DTV_STREAM_ID); | |
if (stream_id == NO_STREAM_ID_FILTER) return transponderParameters.pls_mode; | |
return (stream_id >> 26) & 0x3; | |
@@ -359,6 +362,9 @@ int eDVBSatelliteTransponderData::getPLSCode() const | |
{ | |
if (originalValues) return transponderParameters.pls_code; | |
+ if (getProperty(DTV_API_VERSION) >= DVB_VERSION(5, 11)) | |
+ return getProperty(DTV_SCRAMBLING_SEQUENCE_INDEX); | |
+ | |
unsigned int stream_id = getProperty(DTV_STREAM_ID); | |
if (stream_id == NO_STREAM_ID_FILTER) return transponderParameters.pls_code; | |
return (stream_id >> 8) & 0x3FFFF; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment