From 888cf0a2f81d3c3180fc4ed2f63dc992aac42f39 Mon Sep 17 00:00:00 2001 From: Frank Schmirler Date: Mon, 23 Jun 2014 23:30:55 +0200 Subject: [PATCH] Try changing to other device when receiver got detached --- server/livestreamer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/livestreamer.c b/server/livestreamer.c index c939e1e..e33c60d 100644 --- a/server/livestreamer.c +++ b/server/livestreamer.c @@ -671,6 +671,18 @@ bool cStreamdevLiveStreamer::ProvidesChannel(const cChannel *Channel, int Priori 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) { // switched away live TV. Try previous channel on other device first if (!Channels.SwitchTo(cDevice::CurrentChannel())) {