mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Fixed SetChannelDevice() with NULL channel and EOL in ReadApplication().
This commit is contained in:
parent
d81f700194
commit
5795bb58af
10
device.c
10
device.c
@ -184,7 +184,7 @@ int cSatipDevice::SignalQuality(void) const
|
||||
|
||||
bool cSatipDevice::ProvidesSource(int sourceP) const
|
||||
{
|
||||
//debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||
//debug("cSatipDevice::%s(%u): source=%c", __FUNCTION__, deviceIndexM, cSource::ToChar(sourceP));
|
||||
if (!SatipConfig.IsOperatingModeOff() && !!cSatipDiscover::GetInstance()->GetServer(sourceP)) {
|
||||
int numDisabledSourcesM = SatipConfig.GetDisabledSourcesCount();
|
||||
for (int i = 0; i < numDisabledSourcesM; ++i) {
|
||||
@ -198,7 +198,7 @@ bool cSatipDevice::ProvidesSource(int sourceP) const
|
||||
|
||||
bool cSatipDevice::ProvidesTransponder(const cChannel *channelP) const
|
||||
{
|
||||
debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||
debug("cSatipDevice::%s(%u): transponder=%d source=%c", __FUNCTION__, deviceIndexM, channelP ? channelP->Transponder() : -1, channelP ? cSource::ToChar(channelP->Source()) : '?');
|
||||
return (ProvidesSource(channelP->Source()));
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ bool cSatipDevice::ProvidesChannel(const cChannel *channelP, int priorityP, bool
|
||||
bool hasPriority = (priorityP == IDLEPRIORITY) || (priorityP > this->Priority());
|
||||
bool needsDetachReceivers = false;
|
||||
|
||||
debug("cSatipDevice::%s(%u)", __FUNCTION__, deviceIndexM);
|
||||
debug("cSatipDevice::%s(%u): channel=%d priority=%d", __FUNCTION__, deviceIndexM, channelP ? channelP->Number() : -1, priorityP);
|
||||
|
||||
if (channelP && ProvidesTransponder(channelP)) {
|
||||
result = hasPriority;
|
||||
@ -300,6 +300,10 @@ bool cSatipDevice::SetChannelDevice(const cChannel *channelP, bool liveViewP)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (pTunerM) {
|
||||
pTunerM->SetSource(NULL, NULL, deviceIndexM);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
1
socket.c
1
socket.c
@ -229,6 +229,7 @@ int cSatipSocket::ReadApplication(unsigned char *bufferAddrP, unsigned int buffe
|
||||
if (string_length > 0) {
|
||||
// Set argument point to payload in read buffer
|
||||
memmove(bufferAddrP, &bufferAddrP[offset + 16], string_length);
|
||||
bufferAddrP[string_length] = 0;
|
||||
return string_length;
|
||||
}
|
||||
}
|
||||
|
11
tuner.c
11
tuner.c
@ -255,6 +255,11 @@ bool cSatipTuner::Connect(void)
|
||||
|
||||
// Start playing
|
||||
tunedM = true;
|
||||
if (!pidsM.Size()) {
|
||||
SetPid(0, 5, true);
|
||||
if (nextServerM && nextServerM->Quirk(cSatipServer::eSatipQuirkPlayPids))
|
||||
SetPid(eDummyPid, 5, true);
|
||||
}
|
||||
UpdatePids(true);
|
||||
if (nextServerM) {
|
||||
cSatipDiscover::GetInstance()->UseServer(nextServerM, true);
|
||||
@ -394,6 +399,7 @@ bool cSatipTuner::SetSource(cSatipServer *serverP, const char *parameterP, const
|
||||
{
|
||||
debug("cSatipTuner::%s(%s, %d) [device %d]", __FUNCTION__, parameterP, indexP, deviceM->GetId());
|
||||
cMutexLock MutexLock(&mutexM);
|
||||
if (serverP) {
|
||||
nextServerM = cSatipDiscover::GetInstance()->GetServer(serverP);
|
||||
if (nextServerM && !isempty(nextServerM->Address()) && !isempty(parameterP)) {
|
||||
// Update stream address and parameter
|
||||
@ -402,6 +408,9 @@ bool cSatipTuner::SetSource(cSatipServer *serverP, const char *parameterP, const
|
||||
// Reconnect
|
||||
Connect();
|
||||
}
|
||||
}
|
||||
else
|
||||
Disconnect();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -470,8 +479,6 @@ bool cSatipTuner::UpdatePids(bool forceP)
|
||||
uri = cString::sprintf("%s?pids=", *uri);
|
||||
for (int i = 0; i < pidsM.Size(); ++i)
|
||||
uri = cString::sprintf("%s%d%s", *uri, pidsM[i], (i == (pidsM.Size() - 1)) ? "" : ",");
|
||||
if (currentServerM && currentServerM->Quirk(cSatipServer::eSatipQuirkPlayPids))
|
||||
uri = cString::sprintf("%s,%d", *uri, eDummyPid);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user