diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-12-04 12:45:26 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-12-04 12:45:26 +0100 |
commit | a49ce434f6152a4431b0dd717f4070dc0da401ef (patch) | |
tree | bb1329cf29c377e8424fc1e538ed25110f095c93 /device.c | |
parent | a964269fe9080463cc87aba7b454b6b06b7f8677 (diff) | |
download | vdr-a49ce434f6152a4431b0dd717f4070dc0da401ef.tar.gz vdr-a49ce434f6152a4431b0dd717f4070dc0da401ef.tar.bz2 |
Implemented "Device Bonding"
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 2.43 2011/10/16 14:01:30 kls Exp $ + * $Id: device.c 2.44 2011/10/16 14:36:43 kls Exp $ */ #include "device.h" @@ -640,12 +640,12 @@ const cChannel *cDevice::GetCurrentlyTunedTransponder(void) const return NULL; } -bool cDevice::IsTunedToTransponder(const cChannel *Channel) +bool cDevice::IsTunedToTransponder(const cChannel *Channel) const { return false; } -bool cDevice::MaySwitchTransponder(void) +bool cDevice::MaySwitchTransponder(const cChannel *Channel) const { return time(NULL) > occupiedTimeout && !Receiving(true) && !(pidHandles[ptAudio].pid || pidHandles[ptVideo].pid || pidHandles[ptDolby].pid); } @@ -1488,6 +1488,7 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) int cDevice::Priority(void) const { int priority = IsPrimaryDevice() ? Setup.PrimaryLimit - 1 : DEFAULTPRIORITY; + cMutexLock MutexLock(&mutexReceiver); for (int i = 0; i < MAXRECEIVERS; i++) { if (receiver[i]) priority = max(receiver[i]->priority, priority); @@ -1502,6 +1503,7 @@ bool cDevice::Ready(void) bool cDevice::Receiving(bool CheckAny) const { + cMutexLock MutexLock(&mutexReceiver); for (int i = 0; i < MAXRECEIVERS; i++) { if (receiver[i] && (CheckAny || receiver[i]->priority >= 0)) // cReceiver with priority < 0 doesn't count return true; |