mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +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)
|
||||
{
|
||||
int fd;
|
||||
std::string tsfile;
|
||||
|
||||
time_t msg_start_time = time(0);
|
||||
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START));
|
||||
if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg)
|
||||
hintBox.paint();
|
||||
|
||||
tsfile = std::string(filename) + ".ts";
|
||||
bool standby = hdd_get_standby(Directory.c_str());
|
||||
wakeup_hdd(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]);
|
||||
|
||||
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) {
|
||||
perror(tsfile.c_str());
|
||||
hintBox.hide();
|
||||
return RECORD_INVALID_DIRECTORY;
|
||||
}
|
||||
|
||||
SaveXml();
|
||||
|
||||
CGenPsi psi;
|
||||
numpids = 0;
|
||||
if (allpids.PIDs.vpid != 0){
|
||||
@@ -203,8 +202,6 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||
|
||||
}
|
||||
psi.genpsi(fd);
|
||||
if (standby)
|
||||
hdd_flush(tsfile.c_str());
|
||||
|
||||
#if 0
|
||||
if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS))
|
||||
@@ -222,16 +219,17 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||
record = NULL;
|
||||
close(fd);
|
||||
unlink(tsfile.c_str());
|
||||
std::string xmlfile = std::string(filename) + ".xml";
|
||||
unlink(xmlfile.c_str());
|
||||
hintBox.hide();
|
||||
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)
|
||||
CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing
|
||||
|
||||
start_time = time(0);
|
||||
SaveXml();
|
||||
|
||||
CCamManager::getInstance()->Start(channel->getChannelID(), CCamManager::RECORD);
|
||||
|
||||
|
Reference in New Issue
Block a user