1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Merge pull request #53 from mjanser/fix-uri-generation

Fix URI for x_pmt
This commit is contained in:
Rolf Ahrenberg 2018-10-21 12:30:54 +03:00 committed by GitHub
commit 5254bb7ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

32
tuner.c
View File

@ -486,17 +486,24 @@ bool cSatipTuner::UpdatePids(bool forceP)
cString uri = cString::sprintf("%sstream=%d", *GetBaseUrl(*streamAddrM, streamPortM), streamIdM); cString uri = cString::sprintf("%sstream=%d", *GetBaseUrl(*streamAddrM, streamPortM), streamIdM);
bool useci = (SatipConfig.GetCIExtension() && currentServerM.HasCI()); bool useci = (SatipConfig.GetCIExtension() && currentServerM.HasCI());
bool usedummy = currentServerM.IsQuirk(cSatipServer::eSatipQuirkPlayPids); bool usedummy = currentServerM.IsQuirk(cSatipServer::eSatipQuirkPlayPids);
bool paramadded = false;
if (forceP || usedummy) { if (forceP || usedummy) {
if (pidsM.Size()) if (pidsM.Size()) {
uri = cString::sprintf("%s?pids=%s", *uri, *pidsM.ListPids()); uri = cString::sprintf("%s%spids=%s", *uri, paramadded ? "&" : "?", *pidsM.ListPids());
if (usedummy && (pidsM.Size() == 1) && (pidsM[0] < 0x20)) if (usedummy && (pidsM.Size() == 1) && (pidsM[0] < 0x20))
uri = cString::sprintf("%s,%d", *uri, eDummyPid); uri = cString::sprintf("%s,%d", *uri, eDummyPid);
paramadded = true;
}
} }
else { else {
if (addPidsM.Size()) if (addPidsM.Size()) {
uri = cString::sprintf("%s?addpids=%s", *uri, *addPidsM.ListPids()); uri = cString::sprintf("%s%saddpids=%s", *uri, paramadded ? "&" : "?", *addPidsM.ListPids());
if (delPidsM.Size()) paramadded = true;
uri = cString::sprintf("%s%sdelpids=%s", *uri, addPidsM.Size() ? "&" : "?", *delPidsM.ListPids()); }
if (delPidsM.Size()) {
uri = cString::sprintf("%s%sdelpids=%s", *uri, paramadded ? "&" : "?", *delPidsM.ListPids());
paramadded = true;
}
} }
if (useci) { if (useci) {
if (currentServerM.IsQuirk(cSatipServer::eSatipQuirkCiXpmt)) { if (currentServerM.IsQuirk(cSatipServer::eSatipQuirkCiXpmt)) {
@ -509,9 +516,10 @@ bool cSatipTuner::UpdatePids(bool forceP)
int pid = deviceM->GetPmtPid(); int pid = deviceM->GetPmtPid();
if ((pid > 0) && (pid != pmtPidM)) { if ((pid > 0) && (pid != pmtPidM)) {
int slot = deviceM->GetCISlot(); int slot = deviceM->GetCISlot();
uri = cString::sprintf("%s&x_pmt=%d", *uri, pid); uri = cString::sprintf("%s%sx_pmt=%d", *uri, paramadded ? "&" : "?", pid);
if (slot > 0) if (slot > 0)
uri = cString::sprintf("%s&x_ci=%d", *uri, slot); uri = cString::sprintf("%s&x_ci=%d", *uri, slot);
paramadded = true;
} }
pmtPidM = pid; pmtPidM = pid;
} }
@ -519,8 +527,10 @@ bool cSatipTuner::UpdatePids(bool forceP)
// CI extension parameters: // CI extension parameters:
// - tnr : specifies a channel config entry // - tnr : specifies a channel config entry
cString param = deviceM->GetTnrParameterString(); cString param = deviceM->GetTnrParameterString();
if (!isempty(*param) && strcmp(*tnrParamM, *param) != 0) if (!isempty(*param) && strcmp(*tnrParamM, *param) != 0) {
uri = cString::sprintf("%s&tnr=%s", *uri, *param); uri = cString::sprintf("%s%stnr=%s", *uri, paramadded ? "&" : "?", *param);
paramadded = true;
}
tnrParamM = param; tnrParamM = param;
} }
} }