summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'device.c')
-rw-r--r--device.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/device.c b/device.c
index a3cecf9..1f9611f 100644
--- a/device.c
+++ b/device.c
@@ -286,6 +286,10 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
for (int i = 0; i < numDevices; i++) {
if (device[i] == AvoidDevice)
continue; // this device shall be temporarily avoided
+ // LNB - Sharing
+ if (AvoidDevice && device[i]->IsShareAvoidDevice(Channel, AvoidDevice) )
+ continue; // this device shall be temporarily avoided
+ // LNB - Sharing END
if (Channel->Ca() && Channel->Ca() <= CA_DVB_MAX && Channel->Ca() != device[i]->CardIndex() + 1)
continue; // a specific card was requested, but not this one
if (NumUsableSlots && !CamSlots.Get(j)->Assign(device[i], true))
@@ -764,6 +768,20 @@ int cDevice::GetMaxBadPriority(const cChannel *Channel) const
}
return maxBadPriority;
}
+
+bool cDevice::IsShareAvoidDevice(const cChannel *Channel, const cDevice *AvoidDevice) const
+{
+ if(!cSource::IsSat(Channel->Source())) return false; // no conflict if the new channel is not on sat
+ if(!ProvidesSource(cSource::stSat)) return false; // no conflict if this device is not on sat
+
+ for (int i = 0; i < numDevices; i++) {
+ if (this != device[i] && device[i]->IsShareLnb(this) && device[i]->IsLnbConflict(Channel) ) {
+ // there is a conflict between device[i] and 'this' if we tune this to Channel
+ if(device[i] == AvoidDevice) return true;
+ }
+ }
+ return false;
+}
// ML Ende