Merge branch 'multituner' into dvbsi++

This commit is contained in:
[CST] Focus
2012-03-11 16:30:38 +04:00
4 changed files with 34 additions and 124 deletions

View File

@@ -147,11 +147,13 @@ void * sectionsd_main_thread(void *data);
extern bool timeset; // sectionsd
extern cVideo * videoDecoder;
extern cDemux *videoDemux;
extern cAudio * audioDecoder;
cPowerManager *powerManager;
cCpuFreqManager * cpuFreq;
void stop_daemons(bool stopall = true);
void stop_video(void);
// uncomment if you want to have a "test" menue entry (rasc)
//#define __EXPERIMENTAL_CODE__
@@ -2963,6 +2965,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
standby.timer_minutes_hi = fp_timer >> 8;;
standby.timer_minutes_lo = fp_timer & 0xFF;
stop_video();
int fd = open("/dev/display", O_RDONLY);
if (fd < 0) {
perror("/dev/display");
@@ -3026,7 +3030,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
delete funNotifier;
}
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
//delete frameBuffer;
stop_video();
#if 0 /* FIXME this next hack to test, until we find real crash on exit reason */
system("/etc/init.d/rcK");
system("/bin/sync");
@@ -3050,7 +3055,7 @@ void CNeutrinoApp::saveEpg()
neutrino_msg_data_t data;
g_Sectionsd->writeSI2XML(g_settings.epg_dir.c_str());
while( true ) {
g_RCInput->getMsg(&msg, &data, 300); // 30 secs..
g_RCInput->getMsg(&msg, &data, 1200); // 120 secs..
if (( msg == CRCInput::RC_timeout ) || (msg == NeutrinoMessages::EVT_SI_FINISHED)) {
//printf("Msg %x timeout %d EVT_SI_FINISHED %x\n", msg, CRCInput::RC_timeout, NeutrinoMessages::EVT_SI_FINISHED);
break;
@@ -3608,9 +3613,9 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
delete g_fontRenderer;
delete hintBox;
delete frameBuffer;
stop_daemons(true);
stop_video();
/* g_Timerd, g_Zapit and CVFD are used in stop_daemons */
delete g_Timerd;
delete g_Zapit; //do we really need this?
@@ -3726,10 +3731,17 @@ void stop_daemons(bool stopall)
delete powerManager;
}
cs_deregister_messenger();
cs_api_exit();
}
}
void stop_video()
{
delete videoDecoder;
delete videoDemux;
delete CFrameBuffer::getInstance();
cs_api_exit();
}
void sighandler (int signum)
{
signal (signum, SIG_IGN);
@@ -3739,6 +3751,7 @@ void sighandler (int signum)
delete CRecordManager::getInstance();
CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE);
stop_daemons();
stop_video();
_exit(0);
default:
break;