Fixed channel switch issues with priority > 0

This commit is contained in:
Frank Schmirler 2013-10-30 21:18:56 +01:00
parent 69b654d539
commit 458a21a62a
4 changed files with 24 additions and 23 deletions

View File

@ -221,3 +221,6 @@ thomasjfox
hivdr hivdr
for adding the pos= parameter for replaying recordings from a certain position for adding the pos= parameter for replaying recordings from a certain position
for suggesting to add the HTTP "Server" header for suggesting to add the HTTP "Server" header
hummel99
for helping to debug channel switch issues with priority > 0

View File

@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History VDR Plugin 'streamdev' Revision History
--------------------------------------- ---------------------------------------
- Fixed channel switch issues with priority > 0
- Removed noisy debug messages - Removed noisy debug messages
- Fixed HTTP menu destruction - Fixed HTTP menu destruction
- API change of VDR 2.1.2 - API change of VDR 2.1.2

View File

@ -90,14 +90,6 @@ bool cStreamdevDevice::IsTunedToTransponder(const cChannel *Channel)
bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority,
bool *NeedsDetachReceivers) const { 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) if (m_Disabled || Channel == m_DenyChannel)
return false; return false;
@ -116,6 +108,20 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority,
return false; 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 APIVERSNUM >= 10722
if (IsTunedToTransponder(Channel)) { if (IsTunedToTransponder(Channel)) {
#else #else
@ -129,18 +135,10 @@ bool cStreamdevDevice::ProvidesChannel(const cChannel *Channel, int Priority,
ndr = true; ndr = true;
} }
else if (prio) { else if (prio) {
if (Priority == LIVEPRIORITY) { if (Priority == LIVEPRIORITY && m_ClientSocket->ServerVersion() >= 100)
if (m_ClientSocket->ServerVersion() >= 100) {
Priority = StreamdevClientSetup.LivePriority;
UpdatePriority(true); UpdatePriority(true);
}
else {
if (StreamdevClientSetup.LivePriority >= 0)
Priority = StreamdevClientSetup.LivePriority;
}
}
res = m_ClientSocket->ProvidesChannel(Channel, Priority); res = m_ClientSocket->ProvidesChannel(Channel, newPrio);
ndr = Receiving(); ndr = Receiving();
if (m_ClientSocket->ServerVersion() >= 100) if (m_ClientSocket->ServerVersion() >= 100)

View File

@ -40,10 +40,9 @@ cClientSocket::~cClientSocket()
void cClientSocket::Reset(void) void cClientSocket::Reset(void)
{ {
for (int it = 0; it < si_Count; ++it) { for (int it = 0; it < si_Count; ++it)
if (m_DataSockets[it] != NULL)
DELETENULL(m_DataSockets[it]); DELETENULL(m_DataSockets[it]);
} m_Priority = -100;
} }
cTBSocket *cClientSocket::DataSocket(eSocketId Id) const { cTBSocket *cClientSocket::DataSocket(eSocketId Id) const {