driver/record.cpp: adapt to new frontend management

This commit is contained in:
[CST] Focus
2013-01-09 15:41:43 +04:00
parent 9b74fb88cf
commit bea14518a5

View File

@@ -189,8 +189,9 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
return RECORD_FAILURE; return RECORD_FAILURE;
} }
printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux());
if(!autoshift) if(!autoshift)
CFEManager::getInstance()->lockFrontend(frontend);//FIXME testing CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing
start_time = time(0); start_time = time(0);
SaveXml(); SaveXml();
@@ -228,7 +229,7 @@ bool CRecordInstance::Stop(bool remove_event)
record->Stop(); record->Stop();
if(!autoshift) if(!autoshift)
CFEManager::getInstance()->unlockFrontend(frontend);//FIXME testing CFEManager::getInstance()->unlockFrontend(frontend, true);//FIXME testing
CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD); CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD);
@@ -1578,12 +1579,12 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend *
/* first try to get frontend for record with locked live */ /* first try to get frontend for record with locked live */
bool unlock = true; bool unlock = true;
CFEManager::getInstance()->lockFrontend(live_fe); CFEManager::getInstance()->lockFrontend(live_fe);
frontend = CFEManager::getInstance()->allocateFE(channel); frontend = CFEManager::getInstance()->allocateFE(channel, true);
if (frontend == NULL) { if (frontend == NULL) {
/* no frontend, try again with unlocked live */ /* no frontend, try again with unlocked live */
unlock = false; unlock = false;
CFEManager::getInstance()->unlockFrontend(live_fe); CFEManager::getInstance()->unlockFrontend(live_fe);
frontend = CFEManager::getInstance()->allocateFE(channel); frontend = CFEManager::getInstance()->allocateFE(channel, true);
} }
if (frontend == NULL) if (frontend == NULL)
return false; return false;
@@ -1612,7 +1613,12 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend *
} }
if (unlock) if (unlock)
CFEManager::getInstance()->unlockFrontend(live_fe); CFEManager::getInstance()->unlockFrontend(live_fe);
} else {
frontend = CFEManager::getInstance()->allocateFE(channel, true);
} }
printf("%s: record demux: %d\n", __FUNCTION__, channel->getRecordDemux());
if (channel->getRecordDemux() == 0)
ret = false;
if(ret) { if(ret) {
if(StopSectionsd) { if(StopSectionsd) {
printf("%s: g_Sectionsd->setPauseScanning(true)\n", __FUNCTION__); printf("%s: g_Sectionsd->setPauseScanning(true)\n", __FUNCTION__);