summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-03-23 14:34:53 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-03-23 14:34:53 +0100
commit2d9eb7e25dc08d700b5d2c97d0baf36d5aa35f96 (patch)
treee37483f46ccd457aea0900310ae0345385aaf808 /device.c
parentb7be7c900a4ce4ab74cbc52cee563ff4f0b5bf8f (diff)
downloadvdr-2d9eb7e25dc08d700b5d2c97d0baf36d5aa35f96.tar.gz
vdr-2d9eb7e25dc08d700b5d2c97d0baf36d5aa35f96.tar.bz2
Mapping PIDs in CanDecrypt(); improved description of Start-/StopDecrypting(); removed obsolete cMtdCamSlot::IsDecrypting(); fixed getting device fpr channel up/down
Diffstat (limited to 'device.c')
-rw-r--r--device.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/device.c b/device.c
index b6a6ee10..6f3a155d 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 4.8 2017/03/18 15:45:53 kls Exp $
+ * $Id: device.c 4.9 2017/03/23 14:19:59 kls Exp $
*/
#include "device.h"
@@ -320,8 +320,8 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
if (!NumUsableSlots)
break; // no CAM necessary, so just one loop over the devices
}
- if (d && !Query) {
- if (NeedsDetachReceivers)
+ if (d) {
+ if (!Query && NeedsDetachReceivers)
d->DetachAllReceivers();
if (s) {
// Some of the following statements could probably be combined, but let's keep them
@@ -333,9 +333,11 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
}
else {
// device d has a CAM slot, but it's not the right one
- d->CamSlot()->Assign(NULL);
- s = s->MtdSpawn();
- s->Assign(d);
+ if (!Query) {
+ d->CamSlot()->Assign(NULL);
+ s = s->MtdSpawn();
+ s->Assign(d);
+ }
}
}
else {
@@ -343,9 +345,10 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
if (s->Device() != d) {
// CAM slot s is currently assigned to a different device than d
if (Priority > s->Priority()) {
- s->Device()->DetachAllReceivers();
- d->CamSlot()->Assign(NULL);
- s->Assign(d);
+ if (!Query) {
+ d->CamSlot()->Assign(NULL);
+ s->Assign(d);
+ }
}
else {
d = NULL;
@@ -359,8 +362,10 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
else {
if (s != d->CamSlot()) {
// device d has a CAM slot, but it's not the right one
- d->CamSlot()->Assign(NULL);
- s->Assign(d);
+ if (!Query) {
+ d->CamSlot()->Assign(NULL);
+ s->Assign(d);
+ }
}
else {
// device d already has a proper CAM slot, so nothing to do here
@@ -372,16 +377,20 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
// device d has no CAM slot, ...
if (s->MtdActive()) {
// ... so we assign s with MTD support
- s = s->MtdSpawn();
- s->Assign(d);
+ if (!Query) {
+ s = s->MtdSpawn();
+ s->Assign(d);
+ }
}
else {
// CAM slot s has no MTD support ...
if (s->Device()) {
// ... but it is assigned to a different device, so we reassign it to d
if (Priority > s->Priority()) {
- s->Device()->DetachAllReceivers();
- s->Assign(d);
+ if (!Query) {
+ s->Device()->DetachAllReceivers();
+ s->Assign(d);
+ }
}
else {
d = NULL;
@@ -390,7 +399,8 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool LiveView
}
else {
// ... and is not assigned to any device, so we just assign it to d
- s->Assign(d);
+ if (!Query)
+ s->Assign(d);
}
}
}