diff options
author | Frank Schmirler <vdr@schmirler.de> | 2014-08-31 00:20:35 +0200 |
---|---|---|
committer | Frank Schmirler <vdr@schmirler.de> | 2014-08-31 00:20:35 +0200 |
commit | e8629b5ec6e34abbb8b6dc3e487d65d1c2b1d547 (patch) | |
tree | d79c4e0289120bf15a388d8e2bc059554ccf14a0 /server | |
parent | 703dffa0cbc324c30210b7a65e1d7f86eab4d463 (diff) | |
download | vdr-plugin-streamdev-e8629b5ec6e34abbb8b6dc3e487d65d1c2b1d547.tar.gz vdr-plugin-streamdev-e8629b5ec6e34abbb8b6dc3e487d65d1c2b1d547.tar.bz2 |
Make ChannelChange retune only if CA IDs changed (closes #1767)
Diffstat (limited to 'server')
-rw-r--r-- | server/livestreamer.c | 23 | ||||
-rw-r--r-- | server/livestreamer.h | 1 |
2 files changed, 17 insertions, 7 deletions
diff --git a/server/livestreamer.c b/server/livestreamer.c index 1ddae0c..8dce11d 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -356,6 +356,7 @@ cStreamdevLiveStreamer::cStreamdevLiveStreamer(const cServerConnection *Connecti m_Device = SwitchDevice(Channel, Priority); if (m_Device) 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) { - if (Running() && m_Device && m_Device->ProvidesTransponder(Channel) && ISTRANSPONDER(m_Channel->Transponder(), Channel->Transponder())) { - Detach(); - if (m_Device->SwitchChannel(m_Channel, false)) { - Attach(); - dsyslog("streamdev: channel %d (%s) changed", Channel->Number(), Channel->Name()); + if (Running() && m_Device && m_Channel == Channel) { + // Check whether the Caids actually changed + // If not, no need to re-tune, probably just an Audio PID update + if (!memcmp(m_Caids, Channel->Caids(), sizeof(m_Caids))) { + 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()); } } diff --git a/server/livestreamer.h b/server/livestreamer.h index 36e98d1..055de4d 100644 --- a/server/livestreamer.h +++ b/server/livestreamer.h @@ -28,6 +28,7 @@ private: int m_Priority; int m_Pids[MAXRECEIVEPIDS + 1]; int m_NumPids; + int m_Caids[MAXCAIDS + 1]; eStreamType m_StreamType; const cChannel *m_Channel; cDevice *m_Device; |