mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
driver/record.cpp: testing record without live change, when possible - another try
This commit is contained in:
@@ -815,7 +815,18 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
|||||||
#endif
|
#endif
|
||||||
if(recmap.size() < RECORD_MAX_COUNT) {
|
if(recmap.size() < RECORD_MAX_COUNT) {
|
||||||
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(eventinfo->channel_id);
|
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(eventinfo->channel_id);
|
||||||
|
|
||||||
|
/* first try to get frontend for record with locked live */
|
||||||
|
CFrontend *live_fe = CZapit::getInstance()->GetLiveFrontend();
|
||||||
|
bool unlock = true;
|
||||||
|
CFEManager::getInstance()->lockFrontend(live_fe);
|
||||||
CFrontend * frontend = CFEManager::getInstance()->allocateFE(channel);
|
CFrontend * frontend = CFEManager::getInstance()->allocateFE(channel);
|
||||||
|
if (frontend == NULL) {
|
||||||
|
/* no frontend, try again with unlocked live */
|
||||||
|
unlock = false;
|
||||||
|
CFEManager::getInstance()->unlockFrontend(live_fe);
|
||||||
|
frontend = CFEManager::getInstance()->allocateFE(channel);
|
||||||
|
}
|
||||||
|
|
||||||
int mode = channel->getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE ?
|
int mode = channel->getServiceType() != ST_DIGITAL_RADIO_SOUND_SERVICE ?
|
||||||
NeutrinoMessages::mode_tv : NeutrinoMessages::mode_radio;
|
NeutrinoMessages::mode_tv : NeutrinoMessages::mode_radio;
|
||||||
@@ -849,6 +860,8 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
|||||||
printf("%s add %llx : %s to pending\n", __FUNCTION__, evt->channel_id, evt->epgTitle);
|
printf("%s add %llx : %s to pending\n", __FUNCTION__, evt->channel_id, evt->epgTitle);
|
||||||
nextmap.push_back((CTimerd::RecordingInfo *)evt);
|
nextmap.push_back((CTimerd::RecordingInfo *)evt);
|
||||||
}
|
}
|
||||||
|
if (unlock)
|
||||||
|
CFEManager::getInstance()->unlockFrontend(live_fe);
|
||||||
} else
|
} else
|
||||||
error_msg = RECORD_BUSY;
|
error_msg = RECORD_BUSY;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user