From bf2593efc30711171b67d082ec830bdc979534b8 Mon Sep 17 00:00:00 2001 From: focus Date: Fri, 9 Mar 2012 11:31:57 +0000 Subject: [PATCH 1/3] neutrino.cpp: fix soft-restart git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2143 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 72435138c..df89fe861 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3618,6 +3618,8 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) delete frameBuffer; stop_daemons(true); + delete videoDecoder; + cs_api_exit(); /* g_Timerd, g_Zapit and CVFD are used in stop_daemons */ delete g_Timerd; delete g_Zapit; //do we really need this? From 4710b5b41d5bc11a03d5e6209bf39f6955f171cb Mon Sep 17 00:00:00 2001 From: focus Date: Fri, 9 Mar 2012 13:43:39 +0000 Subject: [PATCH 2/3] gui/streaminfo2.cpp: unify hex numbers to upper case git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2144 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/streaminfo2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 38eda5dcc..5e5d8be56 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -660,26 +660,26 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) spaceoffset = 7 * fontW; //onid ypos+= sheight; - sprintf((char*) buf, "0x%04x (%i)", si.onid, si.onid); + sprintf((char*) buf, "0x%04X (%i)", si.onid, si.onid); g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR, 0, true); // UTF-8 g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8 //sid ypos+= sheight; - sprintf((char*) buf, "0x%04x (%i)", si.sid, si.sid); + sprintf((char*) buf, "0x%04X (%i)", si.sid, si.sid); g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR, 0, true); // UTF-8 g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8 //tsid ypos+= sheight; - sprintf((char*) buf, "0x%04x (%i)", si.tsid, si.tsid); + sprintf((char*) buf, "0x%04X (%i)", si.tsid, si.tsid); g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR, 0, true); // UTF-8 g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8 //pmtpid ypos+= sheight; pmt_version = si.pmt_version; - sprintf((char*) buf, "0x%04x (%i) [%i]", si.pmtpid, si.pmtpid,pmt_version); + sprintf((char*) buf, "0x%04X (%i) [%i]", si.pmtpid, si.pmtpid,pmt_version); g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR, 0, true); // UTF-8 g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8 @@ -687,7 +687,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) //vpid ypos+= sheight; if ( g_RemoteControl->current_PIDs.PIDs.vpid > 0 ){ - sprintf((char*) buf, "0x%04x (%i)", g_RemoteControl->current_PIDs.PIDs.vpid, g_RemoteControl->current_PIDs.PIDs.vpid ); + sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vpid, g_RemoteControl->current_PIDs.PIDs.vpid ); } else { sprintf((char*) buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); } @@ -703,7 +703,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) unsigned int sw=spaceoffset; for (unsigned int li= 0; (licurrent_PIDs.APIDs.size()) && (li<10); li++) { - sprintf((char*) buf, "0x%04x (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid ); + sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid ); if (li == g_RemoteControl->current_PIDs.PIDs.selected_apid){ g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD, 0, true); // UTF-8 } @@ -723,7 +723,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) if ( g_RemoteControl->current_PIDs.PIDs.vtxtpid == 0 ) sprintf((char*) buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE)); else - sprintf((char*) buf, "0x%04x (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid ); + sprintf((char*) buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid ); g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR, 0, true); // UTF-8 g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8 if(box_h == 0) From 4ff2c614b5768714cc54c3386c68ee69e803dd55 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sat, 10 Mar 2012 12:49:37 +0000 Subject: [PATCH 3/3] * Neutrino shutdown: Optimization reworked - Shutdown functions (shutdown, reboot, soft-reboot, sighandler) optimized - Fixed error messages (delete videoDecoder). git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2145 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino.cpp | 22 ++++++++++++++-------- src/zapit/src/zapit.cpp | 1 - 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index df89fe861..ac10ac853 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -144,11 +144,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__ @@ -2969,8 +2971,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) standby.timer_minutes_hi = fp_timer >> 8;; standby.timer_minutes_lo = fp_timer & 0xFF; - delete videoDecoder; - cs_api_exit(); + stop_video(); int fd = open("/dev/display", O_RDONLY); if (fd < 0) { @@ -3035,7 +3036,7 @@ 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"); @@ -3615,11 +3616,9 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) delete g_fontRenderer; delete hintBox; - delete frameBuffer; stop_daemons(true); - delete videoDecoder; - cs_api_exit(); + stop_video(); /* g_Timerd, g_Zapit and CVFD are used in stop_daemons */ delete g_Timerd; delete g_Zapit; //do we really need this? @@ -3737,6 +3736,14 @@ void stop_daemons(bool stopall) } } +void stop_video() +{ + delete videoDecoder; + delete videoDemux; + delete CFrameBuffer::getInstance(); + cs_api_exit(); +} + void sighandler (int signum) { signal (signum, SIG_IGN); @@ -3745,8 +3752,7 @@ void sighandler (int signum) case SIGINT: delete CRecordManager::getInstance(); stop_daemons(); - delete videoDecoder; - cs_api_exit(); + stop_video(); _exit(0); default: break; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index c7eee7c5a..78e9bae00 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2121,7 +2121,6 @@ void CZapit::run() delete pcrDemux; delete pmtDemux; delete audioDecoder; - delete videoDemux; delete audioDemux; INFO("demuxes/decoders deleted");