mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Removed obsolete 'shift' code in device.[hc]
This commit is contained in:
parent
13249f12f2
commit
e7d98d2ee6
1
HISTORY
1
HISTORY
@ -3821,3 +3821,4 @@ Video Disk Recorder Revision History
|
||||
reporting this one).
|
||||
- Fixed error handling in cCiTransportConnection::RecvTPDU() (thanks to Georg Acher
|
||||
for reporting this one).
|
||||
- Removed obsolete 'shift' code in device.[hc].
|
||||
|
55
device.c
55
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 1.109 2005/09/04 14:28:16 kls Exp $
|
||||
* $Id: device.c 1.110 2005/09/17 14:29:44 kls Exp $
|
||||
*/
|
||||
|
||||
#include "device.h"
|
||||
@ -310,22 +310,6 @@ cDevice *cDevice::GetDevice(const cChannel *Channel, int Priority, bool *NeedsDe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*XXX+ too complex with multiple recordings per device
|
||||
if (!d && Ca > MAXDEVICES) {
|
||||
// We didn't find one the easy way, so now we have to try harder:
|
||||
int ShiftLevel = -1;
|
||||
for (int i = 0; i < numDevices; i++) {
|
||||
if (Provides[i]) { // this device is basicly able to do the job, but for some reason we didn't get it above
|
||||
int sl = device[i]->CanShift(Ca, Priority); // asks this device to shift its job to another device
|
||||
if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
|
||||
d = device[i]; // found one that can be shifted with the fewest number of subsequent shifts
|
||||
ShiftLevel = sl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
XXX*/
|
||||
return d;
|
||||
}
|
||||
|
||||
@ -1084,43 +1068,6 @@ int cDevice::Priority(void) const
|
||||
return priority;
|
||||
}
|
||||
|
||||
int cDevice::CanShift(int Ca, int Priority, int UsedCards) const
|
||||
{
|
||||
return -1;//XXX+ too complex with multiple recordings per device
|
||||
/*XXX
|
||||
// Test whether a receiver on this device can be shifted to another one
|
||||
// in order to perform a new receiving with the given Ca and Priority on this device:
|
||||
int ShiftLevel = -1; // default means this device can't be shifted
|
||||
if (UsedCards & (1 << CardIndex()) != 0)
|
||||
return ShiftLevel; // otherwise we would get into a loop
|
||||
if (Receiving()) {
|
||||
if (ProvidesCa(Ca) // this device provides the requested Ca
|
||||
&& (Ca != this->Ca() // the requested Ca is different from the one currently used...
|
||||
|| Priority > this->Priority())) { // ...or the request comes from a higher priority
|
||||
cDevice *d = NULL;
|
||||
int Provides[MAXDEVICES];
|
||||
UsedCards |= (1 << CardIndex());
|
||||
for (int i = 0; i < numDevices; i++) {
|
||||
if ((Provides[i] = device[i]->ProvidesCa(this->Ca())) != 0) { // this device is basicly able to do the job
|
||||
if (device[i] != this) { // it is not _this_ device
|
||||
int sl = device[i]->CanShift(this->Ca(), Priority, UsedCards); // this is the original Priority!
|
||||
if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) {
|
||||
d = device[i];
|
||||
ShiftLevel = sl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ShiftLevel >= 0)
|
||||
ShiftLevel++; // adds the device's own shift
|
||||
}
|
||||
}
|
||||
else if (Priority > this->Priority())
|
||||
ShiftLevel = 0; // no shifting necessary, this device can do the job
|
||||
return ShiftLevel;
|
||||
XXX*/
|
||||
}
|
||||
|
||||
bool cDevice::Ready(void)
|
||||
{
|
||||
return true;
|
||||
|
3
device.h
3
device.h
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: device.h 1.64 2005/09/10 11:54:02 kls Exp $
|
||||
* $Id: device.h 1.65 2005/09/17 14:29:28 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __DEVICE_H
|
||||
@ -485,7 +485,6 @@ public:
|
||||
private:
|
||||
cMutex mutexReceiver;
|
||||
cReceiver *receiver[MAXRECEIVERS];
|
||||
int CanShift(int Ca, int Priority, int UsedCards = 0) const;
|
||||
protected:
|
||||
int Priority(void) const;
|
||||
///< Returns the priority of the current receiving session (0..MAXPRIORITY),
|
||||
|
Loading…
Reference in New Issue
Block a user