Make ChannelChange retune only if CA IDs changed (closes #1767)

This commit is contained in:
Frank Schmirler 2014-08-31 00:20:35 +02:00
parent 703dffa0cb
commit e8629b5ec6
4 changed files with 21 additions and 7 deletions

View File

@ -225,3 +225,6 @@ hivdr
hummel99 hummel99
for reporting and helping to debug channel switch issues with priority > 0 for reporting and helping to debug channel switch issues with priority > 0
for reporting a race condition when switching the server's LiveTV device for reporting a race condition when switching the server's LiveTV device
Oliver Wagner
for making cStatus::ChannelChange re-tune only if CA IDs changed

View File

@ -1,6 +1,7 @@
VDR Plugin 'streamdev' Revision History VDR Plugin 'streamdev' Revision History
--------------------------------------- ---------------------------------------
- Make ChannelChange retune only if CA IDs changed (thanks to Oliver Wagner)
- Implemented VDR 2.1.4 cStatus::ChannelChange(...) - Implemented VDR 2.1.4 cStatus::ChannelChange(...)
- Call detach only if receiver is attached - Call detach only if receiver is attached
- Try changing to other device when receiver got detached - Try changing to other device when receiver got detached

View File

@ -356,6 +356,7 @@ cStreamdevLiveStreamer::cStreamdevLiveStreamer(const cServerConnection *Connecti
m_Device = SwitchDevice(Channel, Priority); m_Device = SwitchDevice(Channel, Priority);
if (m_Device) if (m_Device)
SetChannel(Apid, Dpid); SetChannel(Apid, Dpid);
memcpy(m_Caids,Channel->Caids(),sizeof(m_Caids));
} }
} }
@ -672,14 +673,22 @@ bool cStreamdevLiveStreamer::ProvidesChannel(const cChannel *Channel, int Priori
void cStreamdevLiveStreamer::ChannelChange(const cChannel *Channel) void cStreamdevLiveStreamer::ChannelChange(const cChannel *Channel)
{ {
if (Running() && m_Device && m_Device->ProvidesTransponder(Channel) && ISTRANSPONDER(m_Channel->Transponder(), Channel->Transponder())) { if (Running() && m_Device && m_Channel == Channel) {
Detach(); // Check whether the Caids actually changed
if (m_Device->SwitchChannel(m_Channel, false)) { // If not, no need to re-tune, probably just an Audio PID update
Attach(); if (!memcmp(m_Caids, Channel->Caids(), sizeof(m_Caids))) {
dsyslog("streamdev: channel %d (%s) changed", Channel->Number(), Channel->Name()); dsyslog("streamdev: channel %d (%s) changed, but caids remained the same, not re-tuning", Channel->Number(), Channel->Name());
}
else {
Detach();
if (m_Device->SwitchChannel(m_Channel, false)) {
Attach();
dsyslog("streamdev: channel %d (%s) changed, re-tuned", Channel->Number(), Channel->Name());
memcpy(m_Caids, Channel->Caids(), sizeof(m_Caids));
}
else
isyslog("streamdev: failed to re-tune after channel %d (%s) changed", Channel->Number(), Channel->Name());
} }
else
isyslog("streamdev: failed to re-tune after channel %d (%s) changed", Channel->Number(), Channel->Name());
} }
} }

View File

@ -28,6 +28,7 @@ private:
int m_Priority; int m_Priority;
int m_Pids[MAXRECEIVEPIDS + 1]; int m_Pids[MAXRECEIVEPIDS + 1];
int m_NumPids; int m_NumPids;
int m_Caids[MAXCAIDS + 1];
eStreamType m_StreamType; eStreamType m_StreamType;
const cChannel *m_Channel; const cChannel *m_Channel;
cDevice *m_Device; cDevice *m_Device;