mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
driver/record.cpp: use wakeup_hdd();
save xml before record start
This commit is contained in:
@@ -143,26 +143,25 @@ int CRecordInstance::GetStatus()
|
|||||||
|
|
||||||
record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||||
{
|
{
|
||||||
int fd;
|
|
||||||
std::string tsfile;
|
|
||||||
|
|
||||||
time_t msg_start_time = time(0);
|
time_t msg_start_time = time(0);
|
||||||
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START));
|
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START));
|
||||||
if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg)
|
if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg)
|
||||||
hintBox.paint();
|
hintBox.paint();
|
||||||
|
|
||||||
tsfile = std::string(filename) + ".ts";
|
wakeup_hdd(Directory.c_str());
|
||||||
bool standby = hdd_get_standby(Directory.c_str());
|
|
||||||
|
|
||||||
|
std::string tsfile = std::string(filename) + ".ts";
|
||||||
printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]);
|
printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]);
|
||||||
|
|
||||||
fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU);
|
int fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU);
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
perror(tsfile.c_str());
|
perror(tsfile.c_str());
|
||||||
hintBox.hide();
|
hintBox.hide();
|
||||||
return RECORD_INVALID_DIRECTORY;
|
return RECORD_INVALID_DIRECTORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SaveXml();
|
||||||
|
|
||||||
CGenPsi psi;
|
CGenPsi psi;
|
||||||
numpids = 0;
|
numpids = 0;
|
||||||
if (allpids.PIDs.vpid != 0){
|
if (allpids.PIDs.vpid != 0){
|
||||||
@@ -203,8 +202,6 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
|||||||
|
|
||||||
}
|
}
|
||||||
psi.genpsi(fd);
|
psi.genpsi(fd);
|
||||||
if (standby)
|
|
||||||
hdd_flush(tsfile.c_str());
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS))
|
if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS))
|
||||||
@@ -222,16 +219,17 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
|||||||
record = NULL;
|
record = NULL;
|
||||||
close(fd);
|
close(fd);
|
||||||
unlink(tsfile.c_str());
|
unlink(tsfile.c_str());
|
||||||
|
std::string xmlfile = std::string(filename) + ".xml";
|
||||||
|
unlink(xmlfile.c_str());
|
||||||
hintBox.hide();
|
hintBox.hide();
|
||||||
return RECORD_FAILURE;
|
return RECORD_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux());
|
printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux());
|
||||||
if(!autoshift)
|
if(!autoshift)
|
||||||
CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing
|
CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing
|
||||||
|
|
||||||
start_time = time(0);
|
start_time = time(0);
|
||||||
SaveXml();
|
|
||||||
|
|
||||||
CCamManager::getInstance()->Start(channel->getChannelID(), CCamManager::RECORD);
|
CCamManager::getInstance()->Start(channel->getChannelID(), CCamManager::RECORD);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user