capmt: avoid crash with simulated FE debug message

This commit is contained in:
Stefan Seyfried
2014-12-25 18:16:26 +01:00
parent 20363fa8fd
commit 086434c99f

View File

@@ -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); //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 */ /* 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) { switch(mode) {
case PLAY: case PLAY:
#if HAVE_COOL_HARDWARE #if HAVE_COOL_HARDWARE
@@ -237,7 +243,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
#else #else
source = cDemux::GetSource(0); source = cDemux::GetSource(0);
demux = 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 #endif
break; break;
case STREAM: case STREAM:
@@ -248,7 +254,7 @@ bool CCamManager::SetMode(t_channel_id channel_id, enum runmode mode, bool start
#else #else
source = cDemux::GetSource(channel->getRecordDemux()); source = cDemux::GetSource(channel->getRecordDemux());
demux = source; 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 #endif
break; break;
case PIP: case PIP: