diff options
author | Frank Schmirler <vdr@schmirler.de> | 2013-10-30 21:18:56 +0100 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2013-10-30 21:18:56 +0100 |
commit | 458a21a62ad445ce79a55a8bb03b66c2ba280747 (patch) | |
tree | 83634b5e07f25c4050bd8f6015060dcc5a913a5c /client | |
parent | 69b654d5393189c9c23dcc1241d8ab0588bae355 (diff) | |
download | vdr-plugin-streamdev-458a21a62ad445ce79a55a8bb03b66c2ba280747.tar.gz vdr-plugin-streamdev-458a21a62ad445ce79a55a8bb03b66c2ba280747.tar.bz2 |
Fixed channel switch issues with priority > 0
Diffstat (limited to 'client')
-rw-r--r-- | client/device.c | 36 | ||||
-rw-r--r-- | client/socket.c | 7 |
2 files changed, 20 insertions, 23 deletions
diff --git a/client/device.c b/client/device.c index 8a19c25..de0865f 100644 --- a/client/device.c +++ b/client/device.c @@ -90,14 +90,6 @@ bool cStreamdevDevice::IsTunedToTransponder(const cChannel *Channel) bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const { -#if APIVERSNUM >= 10725 - bool prio = Priority == IDLEPRIORITY || Priority >= m_ClientSocket->Priority(); -#else - bool prio = Priority < 0 || Priority > m_ClientSocket->Priority(); -#endif - bool res = prio; - bool ndr = false; - if (m_Disabled || Channel == m_DenyChannel) return false; @@ -116,6 +108,20 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority, return false; } + int newPrio = Priority; + if (Priority == LIVEPRIORITY) { + if (m_ClientSocket->ServerVersion() >= 100 || StreamdevClientSetup.LivePriority >= 0) + newPrio = StreamdevClientSetup.LivePriority; + } + +#if APIVERSNUM >= 10725 + bool prio = Priority == IDLEPRIORITY || newPrio >= m_ClientSocket->Priority(); +#else + bool prio = Priority < 0 || newPrio > m_ClientSocket->Priority(); +#endif + bool res = prio; + bool ndr = false; + #if APIVERSNUM >= 10722 if (IsTunedToTransponder(Channel)) { #else @@ -129,18 +135,10 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority, ndr = true; } else if (prio) { - if (Priority == LIVEPRIORITY) { - if (m_ClientSocket->ServerVersion() >= 100) { - Priority = StreamdevClientSetup.LivePriority; - UpdatePriority(true); - } - else { - if (StreamdevClientSetup.LivePriority >= 0) - Priority = StreamdevClientSetup.LivePriority; - } - } + if (Priority == LIVEPRIORITY && m_ClientSocket->ServerVersion() >= 100) + UpdatePriority(true); - res = m_ClientSocket->ProvidesChannel(Channel, Priority); + res = m_ClientSocket->ProvidesChannel(Channel, newPrio); ndr = Receiving(); if (m_ClientSocket->ServerVersion() >= 100) diff --git a/client/socket.c b/client/socket.c index 23a1dca..eeece5d 100644 --- a/client/socket.c +++ b/client/socket.c @@ -40,10 +40,9 @@ cClientSocket::~cClientSocket() void cClientSocket::Reset(void) { - for (int it = 0; it < si_Count; ++it) { - if (m_DataSockets[it] != NULL) - DELETENULL(m_DataSockets[it]); - } + for (int it = 0; it < si_Count; ++it) + DELETENULL(m_DataSockets[it]); + m_Priority = -100; } cTBSocket *cClientSocket::DataSocket(eSocketId Id) const { |