Merge branch 'ni/mp' into ni/cst-next

Conflicts:
	data/icons/shutdown.jpg
	data/icons/start.jpg
	data/locale/Makefile.am
	data/locale/deutsch.locale
	data/locale/english.locale
	lib/libdvbsub/dvbsub.cpp
	lib/libdvbsub/dvbsubtitle.cpp
	lib/libtuxtxt/tuxtxt.cpp
	lib/libtuxtxt/tuxtxt.h
	src/gui/dboxinfo.cpp
	src/gui/movieplayer.cpp
	src/gui/streaminfo2.cpp
	src/gui/themes.cpp
	src/neutrino.cpp
	src/neutrino_menue.cpp
	src/nhttpd/Makefile.am
	src/system/flashtool.cpp


Origin commit data
------------------
Branch: ni/coolstream
Commit: 161347db29
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-26 (Fri, 26 Aug 2016)



------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2016-08-26 19:13:47 +02:00
220 changed files with 7577 additions and 1615 deletions

View File

@@ -3,7 +3,6 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2006-2014 Stefan Seyfried
@@ -22,8 +21,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
@@ -225,6 +224,9 @@ CNeutrinoFonts * neutrinoFonts = NULL;
bool parentallocked = false;
static char **global_argv;
/* hack until we have real platform abstraction... */
static bool can_deepstandby = false;
extern const char * locale_real_names[]; /* #include <system/locals_intern.h> */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -237,6 +239,11 @@ CNeutrinoApp::CNeutrinoApp()
frameBuffer = CFrameBuffer::getInstance();
frameBuffer->setIconBasePath(ICONSDIR);
#if HAVE_TRIPLEDRAGON || USE_STB_HAL
/* this needs to happen before the framebuffer is set up */
init_td_api();
// shutdown_td_api();
#endif
SetupFrameBuffer();
mode = mode_unknown;
@@ -297,7 +304,7 @@ const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] =
{"lcd_show_volume" , DEFAULT_LCD_SHOW_VOLUME },
{"lcd_autodimm" , DEFAULT_LCD_AUTODIMM },
{"lcd_deepbrightness" , DEFAULT_VFD_STANDBYBRIGHTNESS }
#if HAVE_TRIPLEDRAGON
#if HAVE_TRIPLEDRAGON || USE_STB_HAL
,{ "lcd_epgmode" , 0 /*DEFAULT_LCD_EPGMODE*/ }
#endif
};
@@ -315,10 +322,17 @@ static SNeutrinoSettings::usermenu_t usermenu_default[] = {
/**************************************************************************************
* CNeutrinoApp - loadSetup, load the application-settings *
**************************************************************************************/
#if HAVE_TRIPLEDRAGON || HAVE_SPARK_HARDWARE || HAVE_GENERIC_HARDWARE
#define DEFAULT_X_START_SD 32
#define DEFAULT_Y_START_SD 26
#define DEFAULT_X_END_SD 694
#define DEFAULT_Y_END_SD 570
#else
#define DEFAULT_X_START_SD 60
#define DEFAULT_Y_START_SD 20
#define DEFAULT_X_END_SD 1220
#define DEFAULT_Y_END_SD 560
#endif
#define DEFAULT_X_START_HD 45 //5 //NI
#define DEFAULT_Y_START_HD 30 //5 //NI
@@ -386,7 +400,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
dprintf(DEBUG_NORMAL, "g_settings.easymenu %d\n", g_settings.easymenu);
// video
g_settings.video_Mode = configfile.getInt32("video_Mode", VIDEO_STD_1080I50); // VIDEO_STD_720P50
#if HAVE_TRIPLEDRAGON
int vid_Mode_default = VIDEO_STD_PAL;
#else
int vid_Mode_default = VIDEO_STD_720P50;
if (getenv("NEUTRINO_DEFAULT_SCART") != NULL)
vid_Mode_default = VIDEO_STD_PAL;
#endif
g_settings.video_Mode = configfile.getInt32("video_Mode", vid_Mode_default);
#ifdef ANALOG_MODE
g_settings.analog_mode1 = configfile.getInt32("analog_mode1", (int)ANALOG_MODE(BOTH,SD,RGB)); // default RGB
g_settings.analog_mode2 = configfile.getInt32("analog_mode2", (int)ANALOG_MODE(CINCH,SD,YPRPB)); // default YPBPR
@@ -436,9 +457,11 @@ int CNeutrinoApp::loadSetup(const char * fname)
sprintf(cfg_key, "enabled_video_mode_%d", i);
g_settings.enabled_video_modes[i] = configfile.getInt32(cfg_key, 0);
}
#if VIDEOMENU_VIDEOMODE_OPTION_COUNT > 3
g_settings.enabled_video_modes[3] = 1; // 720p 50Hz
g_settings.enabled_video_modes[4] = 1; // 1080i 50Hz
g_settings.enabled_video_modes[9] = 1; // 720p 60Hz //NI
#endif
for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) {
sprintf(cfg_key, "enabled_auto_mode_%d", i);
@@ -497,7 +520,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0);
g_settings.shutdown_min = 0;
if(cs_get_revision() > 7)
if (can_deepstandby || cs_get_revision() == 1)
g_settings.shutdown_min = configfile.getInt32("shutdown_min", 000); //NI
g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0);
@@ -773,6 +796,11 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD);
g_settings.screen_preset = configfile.getInt32( "screen_preset", 1);
#if HAVE_TRIPLEDRAGON
g_settings.screen_preset = 0; /* does not make sense to have two configurations for that... */
#elif ! HAVE_COOLSTREAM
g_settings.screen_preset = 1; /* spark is now always using 1280x720 framebuffer */
#endif
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt;
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt;
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
@@ -793,8 +821,13 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.softupdate_mode = configfile.getInt32( "softupdate_mode", 1 );
g_settings.apply_kernel = configfile.getBool("apply_kernel" , false);
g_settings.apply_settings = configfile.getBool("apply_settings" , false);
#if ENABLE_EXTUPDATE
g_settings.softupdate_name_mode_apply = configfile.getInt32( "softupdate_name_mode_apply", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
g_settings.softupdate_name_mode_backup = configfile.getInt32( "softupdate_name_mode_backup", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
#else
g_settings.softupdate_name_mode_apply = 0;
g_settings.softupdate_name_mode_backup = 0; /* unused, but still initialize it */
#endif
g_settings.flashupdate_createimage_add_var = configfile.getInt32( "flashupdate_createimage_add_var", 1);
g_settings.flashupdate_createimage_add_root1 = configfile.getInt32( "flashupdate_createimage_add_root1", 0);
@@ -1775,7 +1808,7 @@ void CNeutrinoApp::SetChannelMode(int newmode)
INFO("newmode %d sort old %d new %d", newmode, sortmode[newmode], g_settings.channellist_sort_mode);
if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < CChannelList::SORT_MAX) {
sortmode[newmode] = g_settings.channellist_sort_mode;
INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, (int)bouquetList->Bouquets.size());
INFO("sorting, mode %d, %d bouquets", g_settings.channellist_sort_mode, (int)bouquetList->Bouquets.size());
for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) {
if(g_settings.channellist_sort_mode == CChannelList::SORT_ALPHA)
bouquetList->Bouquets[i]->channelList->SortAlpha();
@@ -2019,6 +2052,14 @@ void CNeutrinoApp::InitZapitClient()
void CNeutrinoApp::InitSectiondClient()
{
#if 0
/* TODO: check if still needed */
/* wait for sectionsd to be able to process our registration */
time_t t = time_monotonic_ms();
while (! sectionsd_isReady())
sleep(0);
dprintf(DEBUG_NORMAL, "had to wait %ld ms for sectionsd to start up\n", time_monotonic_ms() - t);
#endif
g_Sectionsd = new CSectionsdClient;
g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME);
g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME);
@@ -2030,7 +2071,7 @@ void CNeutrinoApp::InitSectiondClient()
#include <cs_frontpanel.h>
#endif
void wake_up( bool &wakeup)
void wake_up(bool &wakeup)
{
#if HAVE_COOL_HARDWARE
#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
@@ -2052,13 +2093,18 @@ void wake_up( bool &wakeup)
close(fd);
}
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
#endif
/* not platform specific - this is created by the init process */
if (access("/tmp/.timer_wakeup", F_OK) == 0) {
wakeup = 1;
unlink("/tmp/.timer_wakeup");
}
if(!wakeup){
puts("[neutrino.cpp] executing " NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT ".");
if (my_system(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT) != 0)
perror(NEUTRINO_LEAVE_DEEPSTANDBY_SCRIPT " failed");
}
#endif
}
int CNeutrinoApp::run(int argc, char **argv)
@@ -2069,6 +2115,10 @@ TIMER_START();
cs_api_init();
cs_register_messenger(CSSendMessage);
g_info.hw_caps = get_hwcaps();
can_deepstandby = g_info.hw_caps->can_shutdown;
g_info.has_fan = g_info.hw_caps->has_fan;
g_Locale = new CLocaleManager;
int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE);
@@ -2165,14 +2215,14 @@ TIMER_START();
InitZapitClient();
g_Zapit->setStandby(false);
g_info.hw_caps = get_hwcaps();
CheckFastScan();
//timer start
long timerd_signal = 0;
timer_wakeup = false;//init
wake_up( timer_wakeup );
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *) (timer_wakeup && g_settings.shutdown_timer_record_type));
timerd_thread_started = true;
init_cec_setting = true;
if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){
@@ -2184,6 +2234,10 @@ TIMER_START();
timer_wakeup = (timer_wakeup && g_settings.shutdown_timer_record_type);
g_settings.shutdown_timer_record_type = false;
timerd_signal = (timer_wakeup && g_settings.shutdown_timer_record_type);
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *)&timerd_signal);
timerd_thread_started = true;
powerManager = new cPowerManager;
powerManager->Open();
@@ -2245,6 +2299,11 @@ TIMER_START();
InitSectiondClient();
/* wait until timerd is ready... */
time_t timerd_wait = time_monotonic_ms();
while (timerd_signal >= 0)
usleep(100);
dprintf(DEBUG_NORMAL, "had to wait %ld ms for timerd start...\n", time_monotonic_ms() - timerd_wait);
InitTimerdClient();
// volume
@@ -2286,6 +2345,9 @@ TIMER_START();
hdd->exec(NULL, "");
delete hdd;
hintBox->hide(); // InitZapper also displays a hintbox
delete hintBox;
cCA::GetInstance()->Ready(true);
//InitZapper();
@@ -2324,7 +2386,7 @@ TIMER_STOP("################################## after all #######################
}
RealRun();
ExitRun(true, (cs_get_revision() > 7));
ExitRun(true, can_deepstandby);
return 0;
}
@@ -2475,7 +2537,7 @@ void CNeutrinoApp::RealRun()
m_idletime = time(NULL);
if (m_screensaver)
{
printf("[neutrino] CSreenSaver stop; msg: %X\n", msg);
printf("[neutrino] CSreenSaver stop; msg: %lX\n", msg);
screensaver(false);
frameBuffer->stopFrame();
@@ -2571,6 +2633,7 @@ void CNeutrinoApp::RealRun()
InfoClock->enableInfoClock(true);
InfoIcons->enableInfoIcons(true); //NI InfoIcons
}
#ifdef SCREENSHOT
else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
for(int i = 0; i < g_settings.screenshot_count; i++) {
CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format);
@@ -2578,6 +2641,7 @@ void CNeutrinoApp::RealRun()
sc->Start();
}
}
#endif
else if( msg == (neutrino_msg_t) g_settings.key_lastchannel ) {
// Quick Zap
numericZap( msg );
@@ -2739,6 +2803,8 @@ void CNeutrinoApp::RealRun()
CTimerList Timerlist;
Timerlist.exec(NULL, "");
}
else if (msg == CRCInput::RC_aux)
scartMode(true);
else {
if (msg == CRCInput::RC_home)
{
@@ -2755,7 +2821,7 @@ void CNeutrinoApp::RealRun()
}
else {
// mode == mode_scart
if( msg == CRCInput::RC_home ) {
if (msg == CRCInput::RC_home || msg == CRCInput::RC_aux) {
if( mode == mode_scart ) {
// Scart-Mode verlassen
scartMode( false );
@@ -2957,7 +3023,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
if(msg == NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE) {
t_channel_id chid = *(t_channel_id *) data;
printf("EVT_WEBTV_ZAP_COMPLETE: %llx\n", chid);
printf("EVT_WEBTV_ZAP_COMPLETE: %" PRIx64 "\n", chid);
if (mode == mode_standby) {
delete [] (unsigned char*) data;
} else {
@@ -3024,9 +3090,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
res = res | g_RemoteControl->handleMsg(msg, data);
res = res | g_InfoViewer->handleMsg(msg, data);
//NI
if (channelList)
if (channelList) /* can be not yet ready during startup */
res = res | channelList->handleMsg(msg, data);
// else fprintf(stderr, "channelList = NULL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
res = res | CRecordManager::getInstance()->handleMsg(msg, data);
res = res | CEpgScan::getInstance()->handleMsg(msg, data);
res = res | CHDDMenuHandler::getInstance()->handleMsg(msg, data);
@@ -3198,6 +3264,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
delete sleepTimer;
return messages_return::handled;
}
#ifdef SCREENSHOT
else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
//video+osd scaled to osd size
CScreenShot * sc = new CScreenShot("", (CScreenShot::screenshot_format_t)g_settings.screenshot_format);
@@ -3205,6 +3272,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
sc->MakeFileName(CZapit::getInstance()->GetCurrentChannelID());
sc->Start();
}
#endif
/* ================================== MESSAGES ================================================ */
else if (msg == NeutrinoMessages::EVT_VOLCHANGED) {
@@ -3421,7 +3489,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled;
}
}
if(g_settings.shutdown_real)
if (g_settings.shutdown_real && can_deepstandby)
g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0);
else
g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0);
@@ -3466,7 +3534,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
}
else if( msg == NeutrinoMessages::SHUTDOWN ) {
if(!skipShutdownTimer) {
ExitRun(true, (cs_get_revision() > 7));
ExitRun(true, can_deepstandby);
}
else {
skipShutdownTimer=false;
@@ -3525,7 +3593,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled;
}
else if( msg == NeutrinoMessages::CHANGEMODE ) {
printf("CNeutrinoApp::handleMsg: CHANGEMODE to %d rezap %d\n", data & mode_mask, (data & norezap) != norezap);
printf("CNeutrinoApp::handleMsg: CHANGEMODE to %d rezap %d\n", (int)(data & mode_mask), (data & norezap) != norezap);
if((data & mode_mask)== mode_radio) {
if( mode != mode_radio ) {
radioMode((data & norezap) != norezap);
@@ -3624,7 +3692,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled;
}
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) {
INFO("###################################### DELETED msg %x data %x\n", msg, data);
INFO("###################################### DELETED msg %lx data %lx\n", msg, data);
delete [] (unsigned char*) data;
return messages_return::handled;
}
@@ -3636,6 +3704,7 @@ extern bool timer_is_rec;//timermanager.cpp
void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
{
printf("[neutrino] %s retcode: %d can_deep: %d\n", __func__, retcode, can_deepstandby);
bool do_shutdown = true;
CRecordManager::getInstance()->StopAutoRecord();
@@ -3680,7 +3749,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
g_settings.shutdown_timer_record_type = timer_is_rec;
saveSetup(NEUTRINO_SETTINGS_FILE);
#if 0
if(retcode) {
#endif
puts("[neutrino.cpp] executing " NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT ".");
if (my_system(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT) != 0)
perror(NEUTRINO_ENTER_DEEPSTANDBY_SCRIPT " failed");
@@ -3690,9 +3761,11 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
InfoIcons->saveIconstate();
printf("entering off state\n");
printf("timer_minutes: %ld\n", timer_minutes);
mode = mode_off;
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
#if 0
{
fp_standby_data_t standby;
time_t mtime = time(NULL);
@@ -3758,18 +3831,76 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
}
}
} else {
#endif
int leds = 0;
int bright = 0;
#if HAVE_COOL_HARDWARE
if (retcode) {
leds = 0x40;
switch (g_settings.led_deep_mode){
case 0:
leds = 0x0;//off leds
break;
case 1:
leds = 0x60;//on led1 & 2
break;
case 2:
leds = 0x20;//led1 on , 2 off
break;
case 3:
leds = 0x40;//led2 off, 2 on
break;
default:
break;
}
if (leds && g_settings.led_blink && timer_minutes)
leds |= 0x80;
}
if (cs_get_revision() != 10)
bright = g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS];
#endif
if (timer_minutes || leds)
{
FILE *f = fopen("/tmp/.timer", "w");
if (f)
{
fprintf(stderr, "timer_wakeup: %ld\n", timer_minutes * 60);
fprintf(f, "%ld\n", timer_minutes * 60);
fprintf(f, "%d\n", leds);
fprintf(f, "%d\n", bright);
fclose(f);
}
else
perror("fopen /tmp/.timer");
}
delete g_RCInput;
g_RCInput = NULL;
//NI my_system("/etc/init.d/rcK");
//fan speed
if (g_info.has_fan) {
CFanControlNotifier::setSpeed(0);
}
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
delete CVFD::getInstance();
delete SHTDCNT::getInstance();
stop_video();
printf("[neutrino] This is the end. exiting with code %d\n", retcode);
Cleanup();
//_exit(retcode);
#if HAVE_COOL_HARDWARE
FILE *f = fopen("/tmp/.shutdown", "w");
fclose(f);
#endif
#ifdef __sh__
/* the sh4 gcc seems to dislike someting about openthreads... */
_exit(retcode);
#else
exit(retcode);
#endif
#if 0
}
#endif
}
}
@@ -3871,13 +4002,22 @@ void CNeutrinoApp::scartMode( bool bOnOff )
frameBuffer->paintBackground();
//g_Controld->setScartMode( 1 );
#if HAVE_TRIPLEDRAGON
/* would this hurt on Coolstream? */
videoDecoder->Stop(true);
videoDecoder->Standby(true);
#endif
CVFD::getInstance()->setMode(CVFD::MODE_SCART);
lastMode = mode;
mode = mode_scart;
} else {
// SCART AUS
//g_Controld->setScartMode( 0 );
#if HAVE_TRIPLEDRAGON
/* could actually go into radioMode() and tvMode()? */
videoDecoder->Standby(false);
videoDecoder->Start();
#endif
mode = mode_unknown;
//re-set mode
if( lastMode == mode_radio ) {
@@ -3907,6 +4047,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if ( FILE *f = fopen("/tmp/.ni-standby", "w") )
fclose(f);
CVFD::getInstance()->ShowText("standby... ");
if( mode == mode_scart ) {
//g_Controld->setScartMode( 0 );
}
@@ -3990,14 +4131,15 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
} else {
// Active standby off
powerManager->SetStandby(false, false);
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance()->ShowText("resume... ");
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
videoDecoder->Standby(false);
CEpgScan::getInstance()->Stop();
CSectionsdClient::CurrentNextInfo dummy;
g_InfoViewer->getEPG(0, dummy);
g_RCInput->killTimer(fst_timer);
CSectionsdClient::CurrentNextInfo dummy; //NI
g_InfoViewer->getEPG(0, dummy); //NI
if(init_cec_setting){
//init cec settings
CCECSetup cecsetup;
@@ -4046,6 +4188,12 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if(!recordingstatus) { //only switch to standby_channel_id when not recording
live_channel_id = standby_channel_id;
}
#if 0
/* todo: check parental pin */
videoDecoder->Standby(false);
channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */
channelList->zapTo_ChannelID(live_channel_id);
#endif
channelList->zapTo_ChannelID(live_channel_id, true); /* force re-zap */
g_Sectionsd->setPauseScanning(false);
@@ -4272,11 +4420,12 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
delete hintBox;
stop_daemons(true);
delete CVFD::getInstance();
delete SHTDCNT::getInstance();
stop_video();
/* g_Timerd, g_Zapit and CVFD are used in stop_daemons */
delete g_Timerd;
delete g_Zapit; //do we really need this?
delete CVFD::getInstance();
for(int i = 3; i < 256; i++)
close(i);
@@ -4462,9 +4611,14 @@ void sighandler (int signum)
delete CRecordManager::getInstance();
//CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE);
stop_daemons();
delete CVFD::getInstance();
delete SHTDCNT::getInstance();
stop_video();
//_exit(0);
#ifdef __sh__
_exit(0);
#else
exit(0);
#endif
default:
break;
}
@@ -4560,7 +4714,7 @@ void CNeutrinoApp::loadKeys(const char * fname)
/* options */
g_settings.menu_left_exit = tconfig.getInt32( "menu_left_exit", 0 );
g_settings.key_click = tconfig.getInt32( "key_click", 1 );
g_settings.repeat_blocker = tconfig.getInt32("repeat_blocker", 150);
g_settings.repeat_blocker = tconfig.getInt32("repeat_blocker", 450);
g_settings.repeat_genericblocker = tconfig.getInt32("repeat_genericblocker", 100);
g_settings.longkeypress_duration = tconfig.getInt32("longkeypress_duration", LONGKEYPRESS_OFF);
@@ -4665,7 +4819,7 @@ void CNeutrinoApp::saveKeys(const char * fname)
void CNeutrinoApp::StopSubtitles()
{
printf("[neutrino] %s\n", __FUNCTION__);
//printf("[neutrino] %s\n", __FUNCTION__);
int ttx, dvbpid, ttxpid, ttxpage;
dvbpid = dvbsub_getpid();
@@ -4683,7 +4837,7 @@ void CNeutrinoApp::StopSubtitles()
void CNeutrinoApp::StartSubtitles(bool show)
{
printf("%s: %s\n", __FUNCTION__, show ? "Show" : "Not show");
//printf("%s: %s\n", __FUNCTION__, show ? "Show" : "Not show");
if(!show)
return;
dvbsub_start(0);
@@ -4831,8 +4985,11 @@ void CNeutrinoApp::Cleanup()
printf("cleanup 18\n");fflush(stdout);
delete g_EpgData; g_EpgData = NULL;
printf("cleanup 19\n");fflush(stdout);
#if 0
/* crashes in destructor???? very strange */
delete g_InfoViewer; g_InfoViewer = NULL;
printf("cleanup 11\n");fflush(stdout);
#endif
delete g_EventList; g_EventList = NULL;
printf("cleanup 12\n");fflush(stdout);
delete g_Locale; g_Locale = NULL;
@@ -4871,11 +5028,11 @@ void CNeutrinoApp::Cleanup()
printf("cleanup 5\n");fflush(stdout);
delete CEitManager::getInstance();
printf("cleanup 6\n");fflush(stdout);
delete CVFD::getInstance();
//delete CVFD::getInstance();
#ifdef __UCLIBC__
malloc_stats(NULL);
#else
malloc_stats();
//malloc_stats();
#endif
#endif
}