Try changing to other device when receiver got detached

This commit is contained in:
Frank Schmirler 2014-06-23 23:30:55 +02:00
parent 1dc1423429
commit 888cf0a2f8

View File

@ -671,6 +671,18 @@ bool cStreamdevLiveStreamer::ProvidesChannel(const cChannel *Channel, int Priori
void cStreamdevLiveStreamer::MainThreadHook() void cStreamdevLiveStreamer::MainThreadHook()
{ {
if (!m_SwitchLive && Running() && m_Device && !m_Device->IsTunedToTransponder(m_Channel) && !IsReceiving()) {
cDevice *dev = SwitchDevice(m_Channel, m_Priority);
if (dev) {
dsyslog("streamdev: Lost channel %d (%s) on device %d. Continuing on device %d.", m_Channel->Number(), m_Channel->Name(), m_Device->CardIndex(), dev->CardIndex());
m_Device = dev;
StartReceiver();
}
else {
isyslog("streamdev: Lost channel %d (%s) on device %d.", m_Channel->Number(), m_Channel->Name(), m_Device->CardIndex());
Stop();
}
}
if (m_SwitchLive) { if (m_SwitchLive) {
// switched away live TV. Try previous channel on other device first // switched away live TV. Try previous channel on other device first
if (!Channels.SwitchTo(cDevice::CurrentChannel())) { if (!Channels.SwitchTo(cDevice::CurrentChannel())) {