mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
Copy eventinfo to put in pending; Attepmt to fix next recording on different transponder
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1591 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -708,6 +708,9 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
|||||||
{
|
{
|
||||||
CRecordInstance * inst;
|
CRecordInstance * inst;
|
||||||
record_error_msg_t error_msg = RECORD_OK;
|
record_error_msg_t error_msg = RECORD_OK;
|
||||||
|
/* for now, empty eventinfo.recordingDir means this is direct record, FIXME better way ?
|
||||||
|
* neutrino check if this channel_id already recording, may be not needed */
|
||||||
|
bool direct_record = timeshift || strlen(eventinfo->recordingDir) == 0;
|
||||||
|
|
||||||
int mode = g_Zapit->isChannelTVChannel(eventinfo->channel_id) ? NeutrinoMessages::mode_tv : NeutrinoMessages::mode_radio;
|
int mode = g_Zapit->isChannelTVChannel(eventinfo->channel_id) ? NeutrinoMessages::mode_tv : NeutrinoMessages::mode_radio;
|
||||||
|
|
||||||
@@ -717,24 +720,19 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
|||||||
if(!CheckRecording(eventinfo))
|
if(!CheckRecording(eventinfo))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if 0
|
|
||||||
if(!CutBackNeutrino(eventinfo->channel_id, mode)) {
|
|
||||||
printf("%s: failed to change channel\n", __FUNCTION__);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
RunStartScript();
|
RunStartScript();
|
||||||
|
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
recmap_iterator_t it = recmap.find(eventinfo->channel_id);
|
recmap_iterator_t it = recmap.find(eventinfo->channel_id);
|
||||||
if(it != recmap.end()) {
|
if(it != recmap.end()) {
|
||||||
inst = it->second;
|
//inst = it->second;
|
||||||
/* for now, empty eventinfo.recordingDir means this is direct record, FIXME better way ?
|
if(direct_record) {
|
||||||
* neutrino check if this channel_id already recording, may be not needed */
|
|
||||||
if(timeshift || strlen(eventinfo->recordingDir) == 0) {
|
|
||||||
error_msg = RECORD_BUSY;
|
error_msg = RECORD_BUSY;
|
||||||
} else {
|
} else {
|
||||||
nextmap.push_back((CTimerd::RecordingInfo *)eventinfo);
|
//nextmap.push_back((CTimerd::RecordingInfo *)eventinfo);
|
||||||
|
CTimerd::RecordingInfo * evt = new CTimerd::RecordingInfo(*eventinfo);
|
||||||
|
printf("%s add %llx : %s to pending\n", __FUNCTION__, evt->channel_id, evt->epgTitle);
|
||||||
|
nextmap.push_back((CTimerd::RecordingInfo *)evt);
|
||||||
}
|
}
|
||||||
} else if(recmap.size() < RECORD_MAX_COUNT) {
|
} else if(recmap.size() < RECORD_MAX_COUNT) {
|
||||||
if(CutBackNeutrino(eventinfo->channel_id, mode)) {
|
if(CutBackNeutrino(eventinfo->channel_id, mode)) {
|
||||||
@@ -760,6 +758,10 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
|
|||||||
} else {
|
} else {
|
||||||
delete inst;
|
delete inst;
|
||||||
}
|
}
|
||||||
|
} else if(!direct_record) {
|
||||||
|
CTimerd::RecordingInfo * evt = new CTimerd::RecordingInfo(*eventinfo);
|
||||||
|
printf("%s add %llx : %s to pending\n", __FUNCTION__, evt->channel_id, evt->epgTitle);
|
||||||
|
nextmap.push_back((CTimerd::RecordingInfo *)evt);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
error_msg = RECORD_BUSY;
|
error_msg = RECORD_BUSY;
|
||||||
@@ -948,9 +950,9 @@ bool CRecordManager::Stop(const CTimerd::RecordingStopInfo * recinfo)
|
|||||||
|
|
||||||
void CRecordManager::StopPostProcess()
|
void CRecordManager::StopPostProcess()
|
||||||
{
|
{
|
||||||
|
RestoreNeutrino();
|
||||||
StartNextRecording();
|
StartNextRecording();
|
||||||
RunStopScript();
|
RunStopScript();
|
||||||
RestoreNeutrino();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CRecordManager::Update(const t_channel_id channel_id)
|
bool CRecordManager::Update(const t_channel_id channel_id)
|
||||||
@@ -1127,6 +1129,8 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, const int mo
|
|||||||
if(SAME_TRANSPONDER(live_channel_id, channel_id)) {
|
if(SAME_TRANSPONDER(live_channel_id, channel_id)) {
|
||||||
printf("%s zapTo_record channel_id %llx\n", __FUNCTION__, channel_id);
|
printf("%s zapTo_record channel_id %llx\n", __FUNCTION__, channel_id);
|
||||||
ret = g_Zapit->zapTo_record(channel_id) == 0;
|
ret = g_Zapit->zapTo_record(channel_id) == 0;
|
||||||
|
} else if(recmap.size()) {
|
||||||
|
ret = false;
|
||||||
} else {
|
} else {
|
||||||
if (mode != last_mode && (last_mode != NeutrinoMessages::mode_standby || mode != CNeutrinoApp::getInstance()->getLastMode())) {
|
if (mode != last_mode && (last_mode != NeutrinoMessages::mode_standby || mode != CNeutrinoApp::getInstance()->getLastMode())) {
|
||||||
CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , mode | NeutrinoMessages::norezap );
|
CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , mode | NeutrinoMessages::norezap );
|
||||||
|
Reference in New Issue
Block a user