From 086434c99fe9efc5436f50f405d8eb57f1e5fc9b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 25 Dec 2014 18:16:26 +0100 Subject: [PATCH] capmt: avoid crash with simulated FE debug message --- src/zapit/src/capmt.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/capmt.cpp b/src/zapit/src/capmt.cpp index 3a9d6f932..7ed24eb44 100644 --- a/src/zapit/src/capmt.cpp +++ b/src/zapit/src/capmt.cpp @@ -229,6 +229,12 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start //INFO("channel %llx [%s] mode %d %s update %d", channel_id, channel->getName().c_str(), mode, start ? "START" : "STOP", force_update); /* FIXME until proper demux management */ +#if ! HAVE_COOL_HARDWARE + CFrontend *dfe = CFEManager::getInstance()->allocateFE(channel); + int fenum = -1; + if (dfe) + fenum = dfe->getNumber(); +#endif switch(mode) { case PLAY: #if HAVE_COOL_HARDWARE @@ -237,7 +243,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start #else source = cDemux::GetSource(0); demux = cDemux::GetSource(0); - INFO("PLAY: fe_num %d dmx_src %d", CFEManager::getInstance()->allocateFE(channel)->getNumber(), cDemux::GetSource(0)); + INFO("PLAY: fe_num %d dmx_src %d", fenum, cDemux::GetSource(0)); #endif break; case STREAM: @@ -248,7 +254,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start #else source = cDemux::GetSource(channel->getRecordDemux()); demux = source; - INFO("RECORD/STREAM(%d): fe_num %d rec_dmx %d dmx_src %d", mode, CFEManager::getInstance()->allocateFE(channel)->getNumber(), channel->getRecordDemux(), demux); + INFO("RECORD/STREAM(%d): fe_num %d rec_dmx %d dmx_src %d", mode, fenum, channel->getRecordDemux(), demux); #endif break; case PIP: