From 3a1da7437484c4a695ac72f7b38bc4ba7dc4baa6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 10 Jan 2016 21:55:44 +0100 Subject: [PATCH 01/27] - cc_frm_signalbars: fix REF_PERCENT_TXT for 100% --- src/gui/components/cc_frm_signalbars.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index e961d98cd..5bea94103 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -34,7 +34,7 @@ #include #define SB_MIN_HEIGHT 12 -#define REF_PERCENT_TXT "00% " +#define REF_PERCENT_TXT "100% " using namespace std; From 19d33dfb981b69504991da46dd110750e5d5fcdc Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 10 Jan 2016 21:57:59 +0100 Subject: [PATCH 02/27] - infoviewer: some more little numbox-alignments --- src/gui/infoviewer.cpp | 34 +++++++++++++++++++--------------- src/gui/infoviewer.h | 1 + 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 13cdd9aa8..f36716dff 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -110,6 +110,7 @@ CInfoViewer::CInfoViewer () ChanNameY = 0; ChanWidth = 0; ChanHeight = 0; + numbox_offset = 0; time_width = 0; time_height = header_height = 0; lastsnr = 0; @@ -200,6 +201,7 @@ void CInfoViewer::start () ChanHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/* * 9/8*/; ChanHeight += g_SignalFont->getHeight()/2; ChanHeight = max(75, ChanHeight); + numbox_offset = 3; BoxStartX = g_settings.screen_StartX + 10; BoxEndX = g_settings.screen_EndX - 10; @@ -744,13 +746,12 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap logo_ok = ( g_settings.infobar_show_channellogo != 0 && ChannelLogoMode != 0); fprintf(stderr, "after showchannellogo, mode = %d ret = %d logo_ok = %d\n",g_settings.infobar_show_channellogo, ChannelLogoMode, logo_ok); - int ChanNumYPos = BoxStartY + ChanHeight; if (g_settings.infobar_sat_display) { std::string name = (IS_WEBTV(current_channel_id))? "WebTV" : CServiceManager::getInstance()->GetSatelliteName(satellitePosition); int satNameWidth = g_SignalFont->getRenderWidth (name); std::string satname_tmp = name; - if (satNameWidth > (ChanWidth - 4)) { - satNameWidth = ChanWidth - 4; + if (satNameWidth > (ChanWidth - numbox_offset*2)) { + satNameWidth = ChanWidth - numbox_offset*2; size_t pos1 = name.find("(") ; size_t pos2 = name.find_last_of(")"); size_t pos0 = name.find(" ") ; @@ -764,13 +765,12 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap satname_tmp +=" "; satname_tmp += name.substr( pos1,pos2-pos1 ); satNameWidth = g_SignalFont->getRenderWidth (satname_tmp); - if (satNameWidth > (ChanWidth - 4)) - satNameWidth = ChanWidth - 4; + if (satNameWidth > (ChanWidth - numbox_offset*2)) + satNameWidth = ChanWidth - numbox_offset*2; } } - int chanH = g_SignalFont->getHeight (); - g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + chanH, satNameWidth, satname_tmp, COL_INFOBAR_TEXT); - ChanNumYPos += 10; + int h_sfont = g_SignalFont->getHeight(); + g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT); } /* TODO: the logic will get much easier once we decouple channellogo and signal bars */ @@ -785,9 +785,9 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap y_tmp += h_sfont; } y_tmp += h_tmp/2 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2; - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2, + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + numbox_offset + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2, y_tmp, - ChanWidth, + ChanWidth - 2*numbox_offset, strChanNum, col_NumBoxText); } @@ -1496,7 +1496,9 @@ void CInfoViewer::showSNR () /* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc. TODO: decouple this */ if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) { - int chanH = g_SignalFont->getHeight(); + int y_freq = 2*g_SignalFont->getHeight(); + if (!g_settings.infobar_sat_display) + y_freq -= g_SignalFont->getHeight()/2; //half line up to center freq vertically int y_numbox = numbox->getYPos(); if ((newfreq && chanready) || SDT_freq_update) { char freq[20]; @@ -1510,13 +1512,15 @@ void CInfoViewer::showSNR () int frequency = CFEManager::getInstance()->getLiveFE()->getFrequency(); snprintf (freq, sizeof(freq), "%d.%d MHz %s", frequency / 1000, frequency % 1000, polarisation.c_str()); - int satNameWidth = g_SignalFont->getRenderWidth (freq); - g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), y_numbox + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT); + int freqWidth = g_SignalFont->getRenderWidth(freq); + if (freqWidth > (ChanWidth - numbox_offset*2)) + freqWidth = ChanWidth - numbox_offset*2; + g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT); SDT_freq_update = false; } if (sigbox == NULL){ - int sb_x = ChanWidth *10/100; - sigbox = new CSignalBox(BoxStartX+sb_x, y_numbox+ChanHeight/2, ChanWidth-2*sb_x, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); + int sigbox_offset = ChanWidth *10/100; + sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); sigbox->doPaintBg(false); } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 176ce02c5..a7300a7d6 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -80,6 +80,7 @@ class CInfoViewer int ChanNameY; int ChanWidth; int ChanHeight; + int numbox_offset; CSectionsdClient::CurrentNextInfo info_CurrentNext; CSectionsdClient::CurrentNextInfo oldinfo; From 0f2c73aed3aaa61683dd4904f94ac76078f8a84f Mon Sep 17 00:00:00 2001 From: defans Date: Thu, 7 Jan 2016 20:47:15 +0100 Subject: [PATCH 03/27] screensaver: add optional colored property --- data/locale/english.locale | 1 + src/gui/osd_setup.cpp | 5 +++-- src/gui/screensaver.cpp | 21 ++++++++++++++++++++- src/gui/screensaver.h | 12 +++++++++++- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index d578034b9..0347295a8 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2159,6 +2159,7 @@ screensaver.dir Directory screensaver.menu Screensaver screensaver.mode Mode screensaver.mode_clock Clock +screensaver.mode_clock_color Clock colored screensaver.mode_image Images screensaver.off Screensaver off screensaver.random Random Images diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 94f878488..f052b5b83 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1422,11 +1422,12 @@ void COsdSetup::showOsdScreenShotSetup(CMenuWidget *menu_screenshot) menu_screenshot->addItem(mc); } -#define SCREENSAVER_MODE_OPTION_COUNT 2 +#define SCREENSAVER_MODE_OPTION_COUNT 3 const CMenuOptionChooser::keyval SCREENSAVER_MODE_OPTIONS[SCREENSAVER_MODE_OPTION_COUNT] = { { 0, LOCALE_SCREENSAVER_MODE_IMAGE }, - { 1, LOCALE_SCREENSAVER_MODE_CLOCK } + { 1, LOCALE_SCREENSAVER_MODE_CLOCK }, + { 2, LOCALE_SCREENSAVER_MODE_CLOCK_COLOR } }; void COsdSetup::showOsdScreensaverSetup(CMenuWidget *menu_screensaver) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index c6cb91405..0cf4ac8b8 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -53,6 +53,7 @@ CScreenSaver::CScreenSaver() index = 0; status_mute = CAudioMute::getInstance()->getStatus(); scr_clock = NULL; + clr.i_color = COL_DARK_GRAY; } CScreenSaver::~CScreenSaver() @@ -250,7 +251,6 @@ void CScreenSaver::paint() if (!scr_clock){ scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); - scr_clock->setTextColor(COL_DARK_GRAY); scr_clock->enableSaveBg(); scr_clock->doPaintBg(false); } @@ -258,7 +258,26 @@ void CScreenSaver::paint() scr_clock->Stop(); scr_clock->kill(); + scr_clock->setTextColor(clr.i_color); scr_clock->setPosP(rand() % 80, rand() % 90); scr_clock->Start(); + + if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) { + srand (time(NULL)); + uint32_t brightness; + + // sorcery, no darkness + do { + clr.i_color = rand(); + brightness = (unsigned int)clr.uc_color.r * 19595 + (unsigned int)clr.uc_color.g * 38469 + (unsigned int)clr.uc_color.b * 7471; + //printf("[%s] %s: brightness: %d\n", __FILE__, __FUNCTION__, brightness>> 16); + } + while(brightness >> 16 < 80); + + clr.i_color &= 0x00FFFFFF; + //printf("[%s] %s: clr.i_color: r %02x g %02x b %02x a %02x\n", __FILE__, __FUNCTION__, clr.uc_color.r, clr.uc_color.g, clr.uc_color.b, clr.uc_color.a); + } + else + clr.i_color = COL_DARK_GRAY; } } diff --git a/src/gui/screensaver.h b/src/gui/screensaver.h index 865a12c08..23adbe940 100644 --- a/src/gui/screensaver.h +++ b/src/gui/screensaver.h @@ -46,11 +46,21 @@ class CScreenSaver : public sigc::trackable bool ReadDir(); void paint(); + union u_color { + struct s_color { + uint8_t b, g, r, a; + } uc_color; + unsigned int i_color; + }; + + u_color clr; + public: enum { SCR_MODE_IMAGE, - SCR_MODE_CLOCK + SCR_MODE_CLOCK, + SCR_MODE_CLOCK_COLOR }; CScreenSaver(); ~CScreenSaver(); diff --git a/src/system/locals.h b/src/system/locals.h index 2fbbe336a..4a3123646 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2186,6 +2186,7 @@ typedef enum LOCALE_SCREENSAVER_MENU, LOCALE_SCREENSAVER_MODE, LOCALE_SCREENSAVER_MODE_CLOCK, + LOCALE_SCREENSAVER_MODE_CLOCK_COLOR, LOCALE_SCREENSAVER_MODE_IMAGE, LOCALE_SCREENSAVER_OFF, LOCALE_SCREENSAVER_RANDOM, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b9ab8d2b4..a5dd56ea8 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2186,6 +2186,7 @@ const char * locale_real_names[] = "screensaver.menu", "screensaver.mode", "screensaver.mode_clock", + "screensaver.mode_clock_color", "screensaver.mode_image", "screensaver.off", "screensaver.random", From d7ac78c0c2d120dea034fa757afb4539f7a5ee52 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 7 Jan 2016 22:36:10 +0100 Subject: [PATCH 04/27] screensaver: rework timeosd handling --- src/gui/screensaver.cpp | 14 ++++++++++++-- src/gui/screensaver.h | 2 +- src/gui/timeosd.cpp | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 0cf4ac8b8..dca06ad99 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -38,7 +38,7 @@ #include "screensaver.h" #include #include -extern CInfoClock *InfoClock; + #include extern cVideo * videoDecoder; @@ -84,6 +84,9 @@ void CScreenSaver::Start() status_mute = CAudioMute::getInstance()->getStatus(); CAudioMute::getInstance()->enableMuteIcon(false); + if(!CInfoClock::getInstance()->isBlocked()) + CInfoClock::getInstance()->disableInfoClock(); + m_viewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); m_viewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); @@ -125,7 +128,7 @@ void CScreenSaver::Stop() if (!OnAfterStop.empty()) OnAfterStop(); else - InfoClock->enableInfoClock(); + CInfoClock::getInstance()->enableInfoClock(); } void* CScreenSaver::ScreenSaverPrg(void* arg) @@ -281,3 +284,10 @@ void CScreenSaver::paint() clr.i_color = COL_DARK_GRAY; } } + +bool CScreenSaver::IsRun() +{ + if(thrScreenSaver) + return true; + return false; +} \ No newline at end of file diff --git a/src/gui/screensaver.h b/src/gui/screensaver.h index 23adbe940..696425fa7 100644 --- a/src/gui/screensaver.h +++ b/src/gui/screensaver.h @@ -65,7 +65,7 @@ class CScreenSaver : public sigc::trackable CScreenSaver(); ~CScreenSaver(); static CScreenSaver* getInstance(); - + bool IsRun(); void Start(); void Stop(); sigc::signal OnBeforeStart; diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index fdc97b3a7..51284dcac 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -33,7 +33,7 @@ #include #include #include - +#include "screensaver.h" CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) @@ -96,7 +96,7 @@ void CTimeOSD::initTimeString() void CTimeOSD::show(time_t time_show, bool force) { time_show /= 1000; - if (!force && (m_mode == MODE_HIDE || m_time_show == time_show)) + if (!force && (m_mode == MODE_HIDE || m_time_show == time_show) || CScreenSaver::getInstance()->IsRun()) return; m_time_show = time_show; From 2ea0c1c1361855687c4387a43499177bbdc0e58e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 10 Jan 2016 22:20:58 +0100 Subject: [PATCH 05/27] - deutsch.locale: add screensaver.mode_clock_color --- data/locale/deutsch.locale | 1 + 1 file changed, 1 insertion(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f7603cff7..e29d389fb 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2159,6 +2159,7 @@ screensaver.dir Verzeichnis screensaver.menu Bildschirmschoner screensaver.mode Modus screensaver.mode_clock Uhr +screensaver.mode_clock_color Farbige Uhr screensaver.mode_image Bilder screensaver.off Bildschirmschoner aus screensaver.random Zufällige Bilderwahl From 3dd2ff8a4a675e87ef341ff0b774df5ccd849638 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Sun, 10 Jan 2016 23:00:13 +0100 Subject: [PATCH 06/27] CTimeOSD: Fix compiler warning "suggest parentheses around '&&' within '||'" --- src/gui/timeosd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index 51284dcac..309377cd9 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -96,7 +96,7 @@ void CTimeOSD::initTimeString() void CTimeOSD::show(time_t time_show, bool force) { time_show /= 1000; - if (!force && (m_mode == MODE_HIDE || m_time_show == time_show) || CScreenSaver::getInstance()->IsRun()) + if (!force && (m_mode == MODE_HIDE || m_time_show == time_show || CScreenSaver::getInstance()->IsRun())) return; m_time_show = time_show; From da83468bfbd83a9a8326352e4886ec09a2887e8c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 11 Jan 2016 15:49:26 +0100 Subject: [PATCH 07/27] - infoviewer: fix width of small rec/ts icon box --- src/gui/infoviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index f36716dff..f28909a5f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -332,6 +332,9 @@ void CInfoViewer::showRecordIcon (const bool show) rec->setShadowWidth(SHADOW_OFFSET/2); rec->setCorner(RADIUS_MIN, CORNER_ALL); } + if (rec->getWidth() != box_len) + rec->setWidth(box_len); + if (!rec->isPainted()) rec->paint(CC_SAVE_SCREEN_NO); From aac438745c8cd142b3928bb43407bb7a0c96eeeb Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 28 Dec 2015 16:16:00 +0100 Subject: [PATCH 08/27] lua_cc_text: fix type to allow compilation with recent gcc --- src/gui/lua/lua_cc_text.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index c71ab058a..a3717e76e 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -98,7 +98,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L) if (font_text >= SNeutrinoSettings::FONT_TYPE_COUNT || font_text < 0) font_text = SNeutrinoSettings::FONT_TYPE_MENU; - int shadow_mode = CC_SHADOW_OFF; + lua_Integer shadow_mode = CC_SHADOW_OFF; if (!tableLookup(L, "has_shadow", shadow_mode)) { std::string tmp1 = "false"; if (tableLookup(L, "has_shadow", tmp1)) From d1ef35957aa6bace593724fd941c3a2495393e97 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 19:36:12 +0100 Subject: [PATCH 09/27] lua_threads: use own assert() macro which does not abort --- src/gui/lua/lua_threads.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_threads.cpp b/src/gui/lua/lua_threads.cpp index 8885f7ea2..c4f7fdee3 100644 --- a/src/gui/lua/lua_threads.cpp +++ b/src/gui/lua/lua_threads.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +//#include #include #include #include @@ -33,6 +33,11 @@ #include #include "lua_threads.h" +#define assert(x) do { \ + if (x) \ + fprintf(stderr, "CLLThread:%s:%d assert(%s) failed\n", __func__, __LINE__, #x); \ +} while (0) + int __strerror_r(int err, char* buf, size_t len) { memset(buf, '\0', len); From 619dacbc2ed9b11b5210408b516c0f8fd56c80e5 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 13 Jan 2016 20:17:44 +0100 Subject: [PATCH 10/27] lua_menue.cpp: Not script abort in case of error in callback... ...functions, display only error message --- src/gui/lua/lua_menue.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/lua/lua_menue.cpp b/src/gui/lua/lua_menue.cpp index fcd421e09..0f3998402 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -56,7 +57,7 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc int status = lua_pcall(L, 2 /* two args */, 1 /* one result */, 0); if (status) { fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - luaL_error(L, " => %s", lua_tostring(L, -1)); + DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); } double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0; return (((int)res == menu_return::RETURN_REPAINT) || ((int)res == menu_return::RETURN_EXIT_REPAINT)); @@ -135,7 +136,7 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0); if (status) { fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - luaL_error(L, " => %s", lua_tostring(L, -1)); + DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); } if (lua_isnumber(L, -1)) res = (int) lua_tonumber(L, -1); @@ -179,7 +180,7 @@ int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*acti int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - luaL_error(L, " => %s", lua_tostring(L, -1)); + DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); } lua_pop(L, 1); } @@ -222,7 +223,7 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - luaL_error(L, " => %s", lua_tostring(L, -1)); + DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); } lua_pop(L, 2); } @@ -260,7 +261,7 @@ int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*a int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - luaL_error(L, " => %s", lua_tostring(L, -1)); + DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); } lua_pop(L, 2); } From c923944636bd2d943282481e083d99a0f8c6bc26 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 14 Jan 2016 19:09:06 +0100 Subject: [PATCH 11/27] src/neutrino.cpp fix possible segfault if g_bouquetManager is NULL --- src/neutrino.cpp | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 871f09e5d..9c5bd6fa8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1357,7 +1357,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) memset(radiosort, -1, sizeof(tvsort)); const char * fav_bouquetname = g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME); - if(g_bouquetManager->existsUBouquet(fav_bouquetname, true) == -1) + if(g_bouquetManager && g_bouquetManager->existsUBouquet(fav_bouquetname, true) == -1) g_bouquetManager->addBouquet(fav_bouquetname, true, true); if(TVbouquetList) delete TVbouquetList; @@ -1507,29 +1507,31 @@ void CNeutrinoApp::channelsInit(bool bOnly) AllFavBouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); /* Favorites and providers bouquets */ tvi = ri = 0; - for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { - CZapitBouquet *b = g_bouquetManager->Bouquets[i]; - if (!b->bHidden) { - if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { - if(b->bUser) - tmp = TVfavList->addBouquet(b); - else - tmp = TVbouquetList->addBouquet(b); + if(g_bouquetManager){ + for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { + CZapitBouquet *b = g_bouquetManager->Bouquets[i]; + if (!b->bHidden) { + if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { + if(b->bUser) + tmp = TVfavList->addBouquet(b); + else + tmp = TVbouquetList->addBouquet(b); - tmp->channelList->SetChannelList(&zapitList); - tvi++; - } - if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { - if(b->bUser) - tmp = RADIOfavList->addBouquet(b); - else - tmp = RADIObouquetList->addBouquet(b); + tmp->channelList->SetChannelList(&zapitList); + tvi++; + } + if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { + if(b->bUser) + tmp = RADIOfavList->addBouquet(b); + else + tmp = RADIObouquetList->addBouquet(b); - tmp->channelList->SetChannelList(&zapitList); - ri++; + tmp->channelList->SetChannelList(&zapitList); + ri++; + } + if(b->bUser) + AllFavBouquetList->addBouquet(b); } - if(b->bUser) - AllFavBouquetList->addBouquet(b); } } #if 0 From 80d68d7e5a3681e4e380325e8d78c3ca93dd35ae Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 14 Jan 2016 19:10:55 +0100 Subject: [PATCH 12/27] src/gui/movieplayer.cpp add https to m3u filter --- src/gui/movieplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index fd822d373..27a4ad4da 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2169,7 +2169,7 @@ void CMoviePlayerGui::parsePlaylist(CFile *file) if (strlen(cLine) > 0 && cLine[0]!='#') { char *url = NULL; - if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) { + if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "https://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) { if (url != NULL) { printf("name %s [%d] url: %s\n", name, dur, url); tmp_file.Name = name; From 53bab09bdad2762710e582877371b89770ba3b6e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 14 Jan 2016 21:58:15 +0100 Subject: [PATCH 13/27] COsdSetup: fix possible crash on font setup in wizard mode Channellist is not initialized in wizard mode. --- src/gui/osd_setup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index f052b5b83..95a9ddb94 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -253,7 +253,8 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) { printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.screen_xres, g_settings.screen_yres); CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST | CNeutrinoFonts::FONTSETUP_DYN_FONT); - CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules + if (CNeutrinoApp::getInstance()->channelList) + CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules } return res; } From fa05d6a4156ececc019435cdeeae0a786e05a9c9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 28 Dec 2015 16:23:26 +0100 Subject: [PATCH 14/27] fix debug output printf type warnings --- src/gui/components/cc_item_picture.cpp | 2 +- src/gui/components/cc_item_progressbar.cpp | 2 +- src/gui/opkg_manager.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index 78ad584df..780add16d 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -263,7 +263,7 @@ void CComponentsPicture::paintPicture() gettimeofday(&t2, NULL); uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL; if (duration) - fprintf(stderr, "\033[33m[CComponentsPicture] %s: %llu ms to paint image \033[0m\n", __func__, duration); + fprintf(stderr, "\033[33m[CComponentsPicture] %s: %" PRIu64 " ms to paint image \033[0m\n", __func__, duration); } } diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index e0e1afbf6..f5234ac2d 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -480,7 +480,7 @@ void CProgressBar::paintProgress(bool do_save_bg) gettimeofday(&t2, NULL); uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL; if (duration) - fprintf(stderr, "\033[33m[CProgressBar] %s: %llu ms to paint progress \033[0m\n",__func__, duration); + fprintf(stderr, "\033[33m[CProgressBar] %s: %" PRIu64 " ms to paint progress \033[0m\n",__func__, duration); } } diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index e140235df..b6c41288d 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -306,10 +306,10 @@ bool COPKGManager::checkSize(const string& pkg_name) //clean up fh.removeDir(OPKG_TEST_DIR); - dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] Package: %s [required size=%lld (free size: %lld)]\n", __func__, __LINE__, pkg_name.c_str(), req_size, free_size); + dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] Package: %s [required size=%" PRId64 " (free size: %" PRId64 ")]\n", __func__, __LINE__, pkg_name.c_str(), req_size, free_size); if (free_size < req_size){ //exit if required size too much - dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: size check freesize=%lld (recommended: %lld)\n", __func__, __LINE__, free_size, req_size); + dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d] WARNING: size check freesize=%" PRId64 " (recommended: %" PRId64 ")\n", __func__, __LINE__, free_size, req_size); return false; } #endif From 04188136a0033d47abe3b93fed6ee103c03df0ed Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 9 Jan 2016 17:02:22 +0100 Subject: [PATCH 15/27] autogen.sh: simplify no idea what the complicated stuff was good for, but it surely broke cross compiling with a openembedded-built SDK, so go for simplicity --- autogen.sh | 67 ++++-------------------------------------------------- 1 file changed, 5 insertions(+), 62 deletions(-) diff --git a/autogen.sh b/autogen.sh index 2240566a3..29edb6cb6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -6,67 +6,10 @@ srcdir=`dirname $0` test -z "$srcdir" && srcdir=. cd "$srcdir" -DIE=0 - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have automake installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -(libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -#(gettext --version) < /dev/null > /dev/null 2>&1 || { -# echo -# echo "You must have gettext installed to compile $package." -# echo "Download the appropriate package for your system," -# echo "or get the source from one of the GNU ftp sites" -# echo "listed in http://www.gnu.org/order/ftp.html" -# DIE=1 -#} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if [ ! -e acinclude.m4 ]; then - for i in .. ../.. ../../..; do - if [ -e `pwd`/$i/acinclude.m4 ]; then - ln -s `pwd`/$i/acinclude.m4 . - fi - done -fi - echo "Generating configuration files for $package, please wait...." -echo " aclocal $ACLOCAL_FLAGS" -aclocal $ACLOCAL_FLAGS -echo " libtoolize --automake" -libtoolize --automake -#echo " gettextize" -#gettextize -echo " autoconf" -autoconf -echo " autoheader" -autoheader -echo " automake --add-missing" -automake --add-missing +aclocal --force +libtoolize --force +autoconf --force +autoheader --force +automake --add-missing --force-missing --foreign From b67062b62e1ebd72d8b77fd32ba03bc36325ee6e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 12 Jan 2016 09:23:55 +0100 Subject: [PATCH 16/27] sectionsd: improve timeThread info messages --- src/eitd/sectionsd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 3df08603a..c739ab56f 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1472,9 +1472,11 @@ void CTimeThread::run() else change(0); - xprintf("%s: getting DVB time (isOpen %d)\n", name.c_str(), isOpen()); + xprintf("%s: get DVB time ch 0x%012" PRIx64 " (isOpen %d)\n", + name.c_str(), current_service, isOpen()); int rc = dmx->Read(static_buf, MAX_SECTION_LENGTH, timeoutInMSeconds); - xprintf("%s: getting DVB time done : %d messaging_neutrino_sets_time %d\n", name.c_str(), rc, messaging_neutrino_sets_time); + xprintf("%s: get DVB time ch 0x%012" PRIx64 " rc: %d neutrino_sets_time %d\n", + name.c_str(), current_service, rc, messaging_neutrino_sets_time); if (rc > 0) { SIsectionTIME st(static_buf); if (st.is_parsed()) { From 364dd416550d0ee1755f5eca77326d5f8dee69f8 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 14:02:03 +0100 Subject: [PATCH 17/27] sectionsd: fix possibly fishy localtime_r usage --- src/eitd/sectionsd.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index c739ab56f..558343e37 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1383,16 +1383,14 @@ void CTimeThread::setSystemTime(time_t tim) { struct timeval tv; struct tm t; - time_t now = time(NULL); - struct tm *tmTime = localtime_r(&now, &t); gettimeofday(&tv, NULL); timediff = int64_t(tim * 1000000 - (tv.tv_usec + tv.tv_sec * 1000000)); + localtime_r(&tv.tv_sec, &t); - xprintf("%s: timediff %" PRId64 ", current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s", name.c_str(), timediff, - tmTime->tm_mday, tmTime->tm_mon+1, tmTime->tm_year+1900, - tmTime->tm_hour, tmTime->tm_min, tmTime->tm_sec, ctime(&tim)); - + xprintf("%s: timediff %" PRId64 ", current: %02d.%02d.%04d %02d:%02d:%02d, dvb: %s", + name.c_str(), timediff, + t.tm_mday, t.tm_mon+1, t.tm_year+1900, t.tm_hour, t.tm_min, t.tm_sec, ctime(&tim)); #if 0 /* if new time less than current for less than 1 second, ignore */ if(timediff < 0 && timediff > (int64_t) -1000000) { From 89f6da98f13d12a3e3cda59ba3ae82521c5c2957 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 15:53:27 +0100 Subject: [PATCH 18/27] rcinput: remove unused code, comment FIXME I think I have mostly deciphered the meaning of this :-) --- src/driver/rcinput.cpp | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index bc7cc2eaa..c11368e01 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -884,39 +884,11 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 { case CSectionsdClient::EVT_TIMESET: { -#if 0 - struct timeval ltv; - gettimeofday(<v, NULL); - int64_t timeOld = ltv.tv_usec + ltv.tv_sec * (int64_t)1000000; - time_t dvbtime = *((time_t*)p); - if (dvbtime) { - printf("[neutrino] timeset event. "); - time_t difftime = dvbtime - ltv.tv_sec; - if (abs(difftime) > 120) - { - printf("difference is %ld s, stepping...\n", difftime); - if (stime(&dvbtime)) - perror("stime"); - } else if (difftime != 0) { - struct timeval oldd; - ltv.tv_sec = difftime; - ltv.tv_usec = 0; - if (adjtime(<v, &oldd)) - perror("adjtime"); - int64_t t = oldd.tv_sec * 1000000LL + oldd.tv_usec; - printf("difference is %ld s, using adjtime(). oldd: %lld us\n", difftime, t); - } else - printf("difference is 0 s, nothing to do...\n"); - } - gettimeofday( <v, NULL ); - int64_t timeNew = ltv.tv_usec + ltv.tv_sec * (int64_t)1000000; - - delete[] p;//new [] delete [] - p = new unsigned char[sizeof(int64_t)]; - *(int64_t*) p = timeNew - timeOld; -#endif printf("[neutrino] CSectionsdClient::EVT_TIMESET: timediff %" PRId64 "\n", *(int64_t*) p); - /* FIXME what this code really do ? */ + /* compensate last_keypress for autorepeat / long press detection + * I doubt this works correcty, if we had kernel 3.4+, using + * EVIOCSCLOCKID ioctl would be better. + * Still guessing the logic behind the condition... */ if ((int64_t)last_keypress > *(int64_t*)p) last_keypress += *(int64_t *)p; From b307b78bf8259f0cac0694e1da95196e878d0c73 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 16:14:10 +0100 Subject: [PATCH 19/27] rcinput/neutrino: avoid the use of EVT_TIMESET sectionsd's EVT_TIMESET was only used to fix time calculations for input repeat detection. I doubt this reliably worked anyway. Just calculate an absolute input timestamp from CLOCK_MONOTONIC and use that. Even better solution would be to use a newer kernel with EVIOCSCLOCKID ioctl, leave that for later :-) --- src/driver/rcinput.cpp | 25 +++++++++++++++++++++---- src/neutrino.cpp | 8 ++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index c11368e01..e8346e09e 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -4,7 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy - Copyright (C) 2008-2012 Stefan Seyfried + Copyright (C) 2008-2014,2016 Stefan Seyfried Copyright (C) 2013-2014 martii License: GPL @@ -519,7 +519,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 //static __u16 rc_last_key = KEY_MAX; static __u16 rc_last_repeat_key = KEY_MAX; - struct timeval tv; struct timeval tvselect; uint64_t InitialTimeout = Timeout; int64_t targetTimeout; @@ -1202,6 +1201,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) { if ((fd_rc[i] != -1) && (FD_ISSET(fd_rc[i], &rfds))) { + uint64_t now_pressed = 0; t_input_event ev; int ret = read(fd_rc[i], &ev, sizeof(t_input_event)); if (ret != sizeof(t_input_event)) { @@ -1214,6 +1214,22 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } if (ev.type == EV_SYN) continue; /* ignore... */ + if (ev.value) { + /* try to compensate for possible changes in wall clock + * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). + * so subtract gettimeofday() from ev.time and then add + * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. + * Everything would be much easier if we could use the post-kernel 3.4 + * EVIOCSCLOCKID ioctl :-) */ + struct timespec t1; + now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; + if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { + struct timeval t2; + gettimeofday(&t2, NULL); + now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; + now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); + } + } SHTDCNT::getInstance()->resetSleepTimer(); if (ev.value && firstKey) { firstKey = false; @@ -1260,11 +1276,12 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 #ifdef RCDEBUG printf("rc_last_key %04x rc_last_repeat_key %04x\n\n", rc_last_key, rc_last_repeat_key); #endif - uint64_t now_pressed; bool keyok = true; - +#if 0 + uint64_t now_pressed; tv = ev.time; now_pressed = (uint64_t) tv.tv_usec + (uint64_t)((uint64_t) tv.tv_sec * (uint64_t) 1000000); +#endif if (trkey == rc_last_key) { /* only allow selected keys to be repeated */ if (mayRepeat(trkey, bAllowRepeatLR) || diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9c5bd6fa8..c2d208e18 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -5,7 +5,7 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ - Copyright (C) 2006-2014 Stefan Seyfried + Copyright (C) 2006-2016 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd @@ -1840,7 +1840,11 @@ void CNeutrinoApp::InitZapitClient() void CNeutrinoApp::InitSectiondClient() { g_Sectionsd = new CSectionsdClient; - g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); + struct timespec t; + if (clock_gettime(CLOCK_MONOTONIC, &t)) { + dprintf(DEBUG_NORMAL, "CLOCK_MONOTONIC not supported? (%m), falling back to EVT_TIMESET\n"); + g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); + } g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME); g_Sectionsd->registerEvent(CSectionsdClient::EVT_EIT_COMPLETE, 222, NEUTRINO_UDS_NAME); g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME); From 73b5303cfcb52cbb621b1783f3de698aa92deb04 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 19:35:09 +0100 Subject: [PATCH 20/27] jsoncpp: use own assert() macro which does not abort --- lib/jsoncpp/include/json/json.h | 5 +++++ lib/jsoncpp/jsoncpp.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/jsoncpp/include/json/json.h b/lib/jsoncpp/include/json/json.h index f27ecfc81..be8136015 100644 --- a/lib/jsoncpp/include/json/json.h +++ b/lib/jsoncpp/include/json/json.h @@ -68,6 +68,11 @@ license you like. // End of content of file: LICENSE // ////////////////////////////////////////////////////////////////////// +/* own assert() which does not abort... */ +#define assert(x) do { \ + if (x) \ + fprintf(stderr, "JSONCPP:%s:%d assert(%s) failed\n", __func__, __LINE__, #x); \ +} while (0) diff --git a/lib/jsoncpp/jsoncpp.cpp b/lib/jsoncpp/jsoncpp.cpp index 7a2c7f0c7..c9e1071c1 100644 --- a/lib/jsoncpp/jsoncpp.cpp +++ b/lib/jsoncpp/jsoncpp.cpp @@ -198,7 +198,7 @@ static inline void fixNumericLocale(char* begin, char* end) { #endif // if !defined(JSON_IS_AMALGAMATION) #include #include -#include +//#include #include #include #include @@ -2223,7 +2223,7 @@ ValueIterator& ValueIterator::operator=(const SelfType& other) { #include #include #include -#include +//#include #ifdef JSON_USE_CPPTL #include #endif @@ -3769,7 +3769,7 @@ Value& Path::make(Value& root) const { #include #include #include -#include +//#include #include #include From 79d800f955f0d7917302234d25d2c45a82724a68 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 12 Jan 2016 10:30:14 +0100 Subject: [PATCH 21/27] - port HWLIB_CFLAGS from neutrino-mp to neutrino-hd --- configure.ac | 3 +++ lib/libdvbsub/Makefile.am | 15 +++------------ lib/libtuxtxt/Makefile.am | 15 ++------------- src/Makefile.am | 12 +++--------- src/daemonc/Makefile.am | 14 +++----------- src/driver/Makefile.am | 15 ++++----------- src/driver/audiodec/Makefile.am | 15 +++------------ src/driver/pictureviewer/Makefile.am | 13 ++----------- src/eitd/Makefile.am | 14 ++------------ src/gui/Makefile.am | 16 +++------------- src/gui/bedit/Makefile.am | 11 ++--------- src/gui/components/Makefile.am | 12 ++---------- src/gui/lua/Makefile.am | 12 +++--------- src/gui/widget/Makefile.am | 15 ++------------- src/lcddisplay/Makefile.am | 3 +++ src/nhttpd/tuxboxapi/Makefile.am | 15 +++------------ src/nhttpd/yhttpd_core/Makefile.am | 11 ++--------- src/system/Makefile.am | 15 +++------------ src/system/mtdutils/Makefile.am | 9 ++------- src/timerd/Makefile.am | 3 ++- src/zapit/src/Makefile.am | 14 ++------------ 21 files changed, 54 insertions(+), 198 deletions(-) diff --git a/configure.ac b/configure.ac index 01ce01d16..c127e9e9f 100644 --- a/configure.ac +++ b/configure.ac @@ -212,6 +212,7 @@ if test "$BOXTYPE" = "coolstream"; then if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) fi +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream -I$(top_srcdir)/src/zapit/include/private' if test "$BOXMODEL" = "apollo"; then if test -e ${srcdir}/lib/libcoolstream2/cs_ir_generic.h; then @@ -220,6 +221,7 @@ fi if test -e ${srcdir}/lib/libcoolstream2/cs_frontpanel.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_FRONTPANEL_H,1,[Define to 1 if you have the header file.]) fi +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2 -I$(top_srcdir)/src/zapit/include/private' fi fi @@ -238,6 +240,7 @@ fi #*** libcoolstream $CSL_VERSION or newer is required! *** #]) #fi +AC_SUBST(HWLIB_CFLAGS) AC_SUBST(LIBCS_CFLAGS) AC_SUBST(LIBCS_LIBS) AC_SUBST(FREETYPE_CFLAGS) diff --git a/lib/libdvbsub/Makefile.am b/lib/libdvbsub/Makefile.am index 16b351cc9..6ac627d08 100644 --- a/lib/libdvbsub/Makefile.am +++ b/lib/libdvbsub/Makefile.am @@ -2,18 +2,9 @@ AM_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/zapit/include - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + -I$(top_srcdir)/src/zapit/include \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/lib/libtuxtxt/Makefile.am b/lib/libtuxtxt/Makefile.am index f88bc9847..7ea232ad1 100644 --- a/lib/libtuxtxt/Makefile.am +++ b/lib/libtuxtxt/Makefile.am @@ -3,19 +3,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ - $(FREETYPE_CFLAGS) - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif - -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + $(FREETYPE_CFLAGS) \ + @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/src/Makefile.am b/src/Makefile.am index aa3a38a24..1a30813fc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,18 +22,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libupnpclient \ @SIGC_CFLAGS@ \ @FREETYPE_CFLAGS@ \ - @LIBCS_CFLAGS@ + @LIBCS_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif if BOXTYPE_TRIPLE SUBDIRS += lcddisplay -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple endif if USE_PUGIXML diff --git a/src/daemonc/Makefile.am b/src/daemonc/Makefile.am index a92b6c3a2..c272b2dee 100644 --- a/src/daemonc/Makefile.am +++ b/src/daemonc/Makefile.am @@ -11,18 +11,10 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libnet \ -I$(top_srcdir)/lib/xmltree \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif noinst_LIBRARIES = libneutrino_daemonc.a diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index e2fc4e41f..965e9083d 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -13,7 +13,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_driver.a libneutrino_driver_netfile.a @@ -45,21 +47,12 @@ libneutrino_driver_a_SOURCES = \ if BOXTYPE_COOL libneutrino_driver_a_SOURCES += \ vfd.cpp +endif -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif if BOXTYPE_TRIPLE libneutrino_driver_a_SOURCES += \ newclock.cpp \ lcdd.cpp - -AM_CPPFLAGS += \ - -I$(top_srcdir)/lib/libtriple endif libneutrino_driver_netfile_a_SOURCES = netfile.cpp - diff --git a/src/driver/audiodec/Makefile.am b/src/driver/audiodec/Makefile.am index fe5d01c74..eccc74b27 100644 --- a/src/driver/audiodec/Makefile.am +++ b/src/driver/audiodec/Makefile.am @@ -9,18 +9,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/zapit/include \ -I$(top_srcdir)/lib/libconfigfile \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_driver_audiodec.a diff --git a/src/driver/pictureviewer/Makefile.am b/src/driver/pictureviewer/Makefile.am index 8ea1ba760..bff7f879e 100644 --- a/src/driver/pictureviewer/Makefile.am +++ b/src/driver/pictureviewer/Makefile.am @@ -8,18 +8,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/lib/libconfigfile \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif noinst_LIBRARIES = libneutrino_pictureviewer.a diff --git a/src/eitd/Makefile.am b/src/eitd/Makefile.am index e98b87194..764ec0395 100644 --- a/src/eitd/Makefile.am +++ b/src/eitd/Makefile.am @@ -7,18 +7,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ - -I$(top_srcdir)/lib/xmltree - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + -I$(top_srcdir)/lib/xmltree \ + @HWLIB_CFLAGS@ #AM_CPPFLAGS = AM_CPPFLAGS += -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index fb5f20e78..73c963593 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -34,19 +34,9 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libupnpclient \ @SIGC_CFLAGS@ \ @CURL_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif - -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libtimerlist.a libneutrino_gui.a libneutrino_gui2.a diff --git a/src/gui/bedit/Makefile.am b/src/gui/bedit/Makefile.am index c161a849c..1aaed9a3d 100644 --- a/src/gui/bedit/Makefile.am +++ b/src/gui/bedit/Makefile.am @@ -10,15 +10,8 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/xmltree \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_gui_bedit.a diff --git a/src/gui/components/Makefile.am b/src/gui/components/Makefile.am index 7f855cf03..0089ac8a1 100644 --- a/src/gui/components/Makefile.am +++ b/src/gui/components/Makefile.am @@ -10,16 +10,8 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/xmltree \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif - + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_gui_components.a diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index 5846d094c..eab73c11d 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -16,15 +16,9 @@ AM_CPPFLAGS += \ @SIGC_CFLAGS@ \ @CURL_CFLAGS@ \ @FREETYPE_CFLAGS@ \ - @LUA_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif + @LUA_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_gui_lua.a diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 60ad5ba8f..ea77f8b29 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -9,19 +9,8 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libnet \ -I$(top_srcdir)/lib/libconfigfile \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif - -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a diff --git a/src/lcddisplay/Makefile.am b/src/lcddisplay/Makefile.am index b21bf8cbf..fe66146cf 100644 --- a/src/lcddisplay/Makefile.am +++ b/src/lcddisplay/Makefile.am @@ -2,6 +2,9 @@ noinst_LIBRARIES = liblcddisplay.a liblcddisplay_a_SOURCES = lcddisplay.cpp fontrenderer.cpp +AM_CPPFLAGS = \ + -I$(top_builddir) + AM_CXXFLAGS = \ @FREETYPE_CFLAGS@ \ @PNG_CFLAGS@ diff --git a/src/nhttpd/tuxboxapi/Makefile.am b/src/nhttpd/tuxboxapi/Makefile.am index 6f30cdb4a..f208f7b02 100644 --- a/src/nhttpd/tuxboxapi/Makefile.am +++ b/src/nhttpd/tuxboxapi/Makefile.am @@ -14,18 +14,9 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/xmltree \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libnhttpd_tuxboxapi.a diff --git a/src/nhttpd/yhttpd_core/Makefile.am b/src/nhttpd/yhttpd_core/Makefile.am index 948eae513..5d95d0e77 100644 --- a/src/nhttpd/yhttpd_core/Makefile.am +++ b/src/nhttpd/yhttpd_core/Makefile.am @@ -9,15 +9,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/libconfigfile \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions -D_FILE_OFFSET_BITS=64 diff --git a/src/system/Makefile.am b/src/system/Makefile.am index 37c20cb21..c0c5df8eb 100644 --- a/src/system/Makefile.am +++ b/src/system/Makefile.am @@ -18,18 +18,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/lib/jsoncpp/include \ @SIGC_CFLAGS@ \ - @FREETYPE_CFLAGS@ - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + @FREETYPE_CFLAGS@ \ + @AVFORMAT_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_system.a diff --git a/src/system/mtdutils/Makefile.am b/src/system/mtdutils/Makefile.am index 0749acd62..a95d77890 100644 --- a/src/system/mtdutils/Makefile.am +++ b/src/system/mtdutils/Makefile.am @@ -15,13 +15,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libmd5sum \ -I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/src/system/mtdutils/include \ - @FREETYPE_CFLAGS@ - -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libneutrino_system_mtdutils.a diff --git a/src/timerd/Makefile.am b/src/timerd/Makefile.am index c3b397da7..4bbe89fa6 100644 --- a/src/timerd/Makefile.am +++ b/src/timerd/Makefile.am @@ -9,7 +9,8 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ - -I$(top_srcdir)/lib/xmltree + -I$(top_srcdir)/lib/xmltree \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libtimerd.a diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index f010bd71d..9ece8df27 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -9,18 +9,8 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ - -I$(top_srcdir)/lib/xmltree - -if BOXTYPE_COOL -if BOXMODEL_APOLLO -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream2 -else -AM_CPPFLAGS += -I$(top_srcdir)/lib/libcoolstream -endif -endif -if BOXTYPE_TRIPLE -AM_CPPFLAGS += -I$(top_srcdir)/lib/libtriple -endif + -I$(top_srcdir)/lib/xmltree \ + @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a From 54e1d3eecb62f4fd8a6d16abd37fe7c35f47b229 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 18:33:27 +0100 Subject: [PATCH 22/27] zapit/debug: remove filename hack with a more elegant one --- configure.ac | 6 ++++++ src/zapit/include/zapit/debug.h | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c127e9e9f..db4a010c3 100644 --- a/configure.ac +++ b/configure.ac @@ -225,6 +225,12 @@ HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2 -I$(top_srcdir)/src/zapit/inclu fi fi +# hack to define a short filename also for out-of-tree build +if test `dirname $0` = `pwd`; then + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' +else + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__="\"$(subst $(srcdir)/,,$(abspath $<))\""' +fi # # Check for libtdservicedb - the new one - for testing only # diff --git a/src/zapit/include/zapit/debug.h b/src/zapit/include/zapit/debug.h index bc40cdfe0..f36d74415 100644 --- a/src/zapit/include/zapit/debug.h +++ b/src/zapit/include/zapit/debug.h @@ -2,6 +2,7 @@ * $Id: debug.h,v 1.7 2003/04/30 04:39:03 obi Exp $ * * (C) 2002-2003 Andreas Oberritter + * (C) 2011,2013,2016 Stefan Seyfried * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -48,14 +49,14 @@ extern int zapit_debug; do { \ if (zapit_debug) \ fprintf(stdout, "[%s:%s:%d] " fmt, \ - __FILE__, __FUNCTION__, \ + __file__, __func__, \ __LINE__ , ## args); \ } while (0) #define ERROR(str) \ do { \ fprintf(stderr, "[%s:%s:%d] %s: %s\n", \ - __FILE__, __FUNCTION__, \ + __file__, __func__, \ __LINE__, str, strerror(errno)); \ } while (0) @@ -64,14 +65,14 @@ extern int zapit_debug; #define INFO(fmt, args...) \ do { \ fprintf(stdout, "[%s:%s:%d] " fmt "\n", \ - __FILE__, __FUNCTION__, \ + __file__, __func__, \ __LINE__ , ## args); \ } while (0) #define WARN(fmt, args...) \ do { \ fprintf(stderr, "[%s:%s:%d] " fmt "\n", \ - __FILE__, __FUNCTION__, \ + __file__, __func__, \ __LINE__ , ## args); \ } while (0) From 70b7f7436285c27844b34e95b2c6b91d6db08d9d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 19:34:31 +0100 Subject: [PATCH 23/27] replace __FILE__ with __file__ --- lib/libdvbsub/tools.h | 2 +- src/eitd/dmx.cpp | 2 +- src/gui/opkg_manager.cpp | 2 +- src/gui/update_ext.h | 4 ++-- src/nhttpd/yhttpd_core/ylogging.h | 6 +++--- src/system/luaserver.cpp | 10 +++++----- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/libdvbsub/tools.h b/lib/libdvbsub/tools.h index caa9bbe14..ed3a2dea3 100644 --- a/lib/libdvbsub/tools.h +++ b/lib/libdvbsub/tools.h @@ -37,7 +37,7 @@ extern int SysLogLevel; #define dsyslog printf #endif -#define LOG_ERROR esyslog("ERROR (%s,%d): %m", __FILE__, __LINE__) +#define LOG_ERROR esyslog("ERROR (%s,%d): %m", __file__, __LINE__) #define LOG_ERROR_STR(s) esyslog("ERROR: %s: %m", s) #define SECSINDAY 86400 diff --git a/src/eitd/dmx.cpp b/src/eitd/dmx.cpp index 184bf25f1..6bd9871ad 100644 --- a/src/eitd/dmx.cpp +++ b/src/eitd/dmx.cpp @@ -321,7 +321,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout if (section_length <= 0) { unlock(); - fprintf(stderr, "[sectionsd] section_length <= 0: %d [%s:%s:%d] please report!\n", section_length, __FILE__,__FUNCTION__,__LINE__); + fprintf(stderr, "[sectionsd] section_length <= 0: %d [%s:%s:%d] please report!\n", section_length, __file__,__func__,__LINE__); return -1; } diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index b6c41288d..46c1ad00e 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -681,7 +681,7 @@ void COPKGManager::getPkgData(const int pkg_content_id) break; } default: - fprintf(stderr, "%s %s %d: unrecognized content id %d\n", __FILE__, __func__, __LINE__, pkg_content_id); + fprintf(stderr, "%s %s %d: unrecognized content id %d\n", __file__, __func__, __LINE__, pkg_content_id); break; } } diff --git a/src/gui/update_ext.h b/src/gui/update_ext.h index 2347e5d07..c33d8c4f8 100644 --- a/src/gui/update_ext.h +++ b/src/gui/update_ext.h @@ -104,14 +104,14 @@ static unsigned int timer_msec; #define DBG_TIMER_STOP(label) \ gettimeofday(&timer_tv2, NULL); \ timer_msec = ((timer_tv2.tv_sec - timer_tv.tv_sec) * 1000) + ((timer_tv2.tv_usec - timer_tv.tv_usec) / 1000); \ - printf("##### [%s] %s: %u msec\n", __FILE__, label, timer_msec); + printf("##### [%s] %s: %u msec\n", __file__, label, timer_msec); #else #define DBG_TIMER_START() #define DBG_TIMER_STOP(label) #endif // UPDATE_DEBUG_TIMER #ifdef UPDATE_DEBUG -#define DBG_MSG(fmt, args...) printf("#### [%s:%s:%d] " fmt "\n", __FILE__, __FUNCTION__, __LINE__ , ## args); +#define DBG_MSG(fmt, args...) printf("#### [%s:%s:%d] " fmt "\n", __file__, __func__, __LINE__ , ## args); #else #define DBG_MSG(fmt, args...) #endif // UPDATE_DEBUG diff --git a/src/nhttpd/yhttpd_core/ylogging.h b/src/nhttpd/yhttpd_core/ylogging.h index b2cf01519..eda350c03 100644 --- a/src/nhttpd/yhttpd_core/ylogging.h +++ b/src/nhttpd/yhttpd_core/ylogging.h @@ -61,11 +61,11 @@ class CLogging // print show file and linenumber #define log_printfX(fmt, args...) \ - do { CLogging::getInstance()->printf("[yhttpd(%s:%d)] " fmt, __FILE__, __LINE__, ## args); } while (0) + do { CLogging::getInstance()->printf("[yhttpd(%s:%d)] " fmt, __file__, __LINE__, ## args); } while (0) //Set Watch Point (show file and linenumber and function) #define WP() \ - do { CLogging::getInstance()->printf("[yhttpd(%s:%d)%s]\n", __FILE__, __LINE__, __FUNCTION__); } while (0) + do { CLogging::getInstance()->printf("[yhttpd(%s:%d)%s]\n", __file__, __LINE__, __FUNCTION__); } while (0) // print if level matches #define log_level_printf(level, fmt, args...) \ @@ -73,7 +73,7 @@ class CLogging // print if level matches / show file and linenumber #define log_level_printfX(level, fmt, args...) \ - do { if(CLogging::getInstance()->LogLevel>=level) CLogging::getInstance()->printf("[yhttpd#%d(%s:%d)] " fmt, level, __FILE__, __LINE__, ## args); } while (0) + do { if(CLogging::getInstance()->LogLevel>=level) CLogging::getInstance()->printf("[yhttpd#%d(%s:%d)] " fmt, level, __file__, __LINE__, ## args); } while (0) // print only if debug is on #define dprintf(fmt, args...) \ diff --git a/src/system/luaserver.cpp b/src/system/luaserver.cpp index f7e0626d9..8232b5268 100644 --- a/src/system/luaserver.cpp +++ b/src/system/luaserver.cpp @@ -218,16 +218,16 @@ bool CLuaServer::luaserver_parse_command(CBasicMessage::Header &rmsg __attribute size_t size; if (!CBasicServer::receive_data(connfd, &size, sizeof(size))) { - fprintf(stderr, "%s %s %d: receive_data failed\n", __FILE__, __func__, __LINE__); + fprintf(stderr, "%s %s %d: receive_data failed\n", __file__, __func__, __LINE__); return true; } char data[size]; if (!CBasicServer::receive_data(connfd, data, size)) { - fprintf(stderr, "%s %s %d: receive_data failed\n", __FILE__, __func__, __LINE__); + fprintf(stderr, "%s %s %d: receive_data failed\n", __file__, __func__, __LINE__); return true; } if (data[size - 1]) { - fprintf(stderr, "%s %s %d: unterminated string\n", __FILE__, __func__, __LINE__); + fprintf(stderr, "%s %s %d: unterminated string\n", __file__, __func__, __LINE__); return true; } std::string luascript; @@ -239,7 +239,7 @@ bool CLuaServer::luaserver_parse_command(CBasicMessage::Header &rmsg __attribute luascript += ".lua"; } if (access(luascript, R_OK)) { - fprintf(stderr, "%s %s %d: %s not found\n", __FILE__, __func__, __LINE__, luascript.c_str()); + fprintf(stderr, "%s %s %d: %s not found\n", __file__, __func__, __LINE__, luascript.c_str()); const char *result_code = "-1"; const char *result_string = ""; std::string error_string = luascript + " not found\n"; @@ -288,7 +288,7 @@ void *CLuaServer::luaserver_main_thread(void *) { CBasicServer server; if (!server.prepare(LUACLIENT_UDS_NAME)) { - fprintf(stderr, "%s %s %d: prepare failed\n", __FILE__, __func__, __LINE__); + fprintf(stderr, "%s %s %d: prepare failed\n", __file__, __func__, __LINE__); pthread_exit(NULL); } From 6757566be29ada44abadc45fa71d9e5509bcd862 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 14 Jan 2016 22:30:18 +0100 Subject: [PATCH 24/27] movieplayer: shorten debug messages --- src/gui/movieplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 27a4ad4da..d54dded4a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -935,7 +935,7 @@ void CMoviePlayerGui::PlayFileLoop(void) update_lcd = true; } #ifdef DEBUG - printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); + printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent); #endif /* in case ffmpeg report incorrect values */ int posdiff = duration - position; @@ -1750,7 +1750,7 @@ void CMoviePlayerGui::UpdatePosition() file_prozent = (unsigned char) (position / (duration / 100)); FileTime.update(position, duration); #ifdef DEBUG - printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); + printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent); #endif } } From 3a41bb86b36621364e4c8a6503b5a057b8ef280b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 14 Jan 2016 22:37:17 +0100 Subject: [PATCH 25/27] CTimeOSD: fix init of display mode Time was always on screen if user has started to play a movie. --- src/gui/timeosd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index 309377cd9..dd62f3659 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -45,7 +45,7 @@ void CTimeOSD::Init() { paint_bg = g_settings.infoClockBackground; m_time_show = time(0); - m_mode = MODE_ASC; + m_mode = MODE_HIDE; //use current theme colors setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); From 06778d42c2d5d4582c2c789a1c1d5ec4e9d08730 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 14 Jan 2016 23:46:50 +0100 Subject: [PATCH 26/27] - configure.ac: remove $(top_srcdir)/src/zapit/include/private Stuff like this maybe is better included in ADDITIONAL_CFLAGS or so. --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index db4a010c3..b0651c6a8 100644 --- a/configure.ac +++ b/configure.ac @@ -212,7 +212,7 @@ if test "$BOXTYPE" = "coolstream"; then if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) fi -HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream -I$(top_srcdir)/src/zapit/include/private' +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream' if test "$BOXMODEL" = "apollo"; then if test -e ${srcdir}/lib/libcoolstream2/cs_ir_generic.h; then @@ -221,7 +221,7 @@ fi if test -e ${srcdir}/lib/libcoolstream2/cs_frontpanel.h; then AC_DEFINE(HAVE_COOLSTREAM_CS_FRONTPANEL_H,1,[Define to 1 if you have the header file.]) fi -HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2 -I$(top_srcdir)/src/zapit/include/private' +HWLIB_CFLAGS='-I$(top_srcdir)/lib/libcoolstream2' fi fi From b00e78a165b4785f0f39a90ac643bc9e9396e3e0 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 15 Jan 2016 13:51:14 +0100 Subject: [PATCH 27/27] - fix pagedown logic, but this time for real (i hope) Why this was so difficult code? I don't know. --- src/gui/bedit/bouqueteditor_bouquets.cpp | 8 +++----- src/gui/bedit/bouqueteditor_channels.cpp | 14 ++++++-------- src/gui/bouquetlist.cpp | 8 +++----- src/gui/channellist.cpp | 8 +++----- src/gui/upnpbrowser.cpp | 8 +++----- src/gui/widget/listbox.cpp | 8 +++----- 6 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index d8f151a87..c588464f0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -292,13 +292,11 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* if (!(Bouquets->empty())) { int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; - if (new_selected >= (int) Bouquets->size()) { - if (((Bouquets->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets->size() - 1))) + if (new_selected > (int) Bouquets->size() - 1) { + if ((selected != Bouquets->size() - 1)) new_selected = Bouquets->size() - 1; - else if (((Bouquets->size() / listmaxshow) + 1) * listmaxshow == Bouquets->size() + listmaxshow) // last page has full entries - new_selected = 0; else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Bouquets->size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets->size() - 1) : 0; + new_selected = 0; } updateSelection(new_selected); } diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 5c0ae0b72..6d92d9cc9 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -380,14 +380,12 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* if (!(Channels->empty())) { int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; - if (new_selected >= (int) Channels->size()) { - if (((Channels->size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Channels->size() - 1))) - new_selected = Channels->size() - 1; - else if (((Channels->size() / listmaxshow) + 1) * listmaxshow == Channels->size() + listmaxshow) // last page has full entries - new_selected = 0; - else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Channels->size() / listmaxshow)+1) * listmaxshow))) ? (Channels->size() - 1) : 0; - } + if (new_selected > (int) Channels->size() - 1) { + if ((selected != Channels->size() - 1)) + new_selected = Channels->size() - 1; + else + new_selected = 0; + } updateSelection(new_selected); } } diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index d46ec06f3..e1ecb09e6 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -546,13 +546,11 @@ int CBouquetList::show(bool bShowChannelList) if (!Bouquets.empty()) { int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; - if (new_selected >= (int) Bouquets.size()) { - if (((Bouquets.size() - listmaxshow -1 < selected) && (step != 1)) || (selected != (Bouquets.size() - 1))) + if (new_selected > (int) Bouquets.size() - 1) { + if ((selected != Bouquets.size() - 1)) new_selected = Bouquets.size() - 1; - else if (((Bouquets.size() / listmaxshow) + 1) * listmaxshow == Bouquets.size() + listmaxshow) // last page has full entries - new_selected = 0; else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((Bouquets.size() / listmaxshow)+1) * listmaxshow))) ? (Bouquets.size() - 1) : 0; + new_selected = 0; } updateSelection(new_selected); } diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 89bfcc921..9c658f5ff 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -742,13 +742,11 @@ int CChannelList::show() displayList = 1; int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; - if (new_selected >= (int) (*chanlist).size()) { - if ((((*chanlist).size() - listmaxshow -1 < selected) && (step != 1)) || (selected != ((*chanlist).size() - 1))) + if (new_selected > (int) (*chanlist).size() - 1) { + if ((selected != (*chanlist).size() - 1)) new_selected = (*chanlist).size() - 1; - else if ((((*chanlist).size() / listmaxshow) + 1) * listmaxshow == (*chanlist).size() + listmaxshow) // last page has full entries - new_selected = 0; else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) ((((*chanlist).size() / listmaxshow)+1) * listmaxshow))) ? ((*chanlist).size() - 1) : 0; + new_selected = 0; } actzap = updateSelection(new_selected); } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index d7cc5de49..509300bb0 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -504,13 +504,11 @@ void CUpnpBrowserGui::selectDevice() { int step = ((int) msg == g_settings.key_pagedown) ? m_listmaxshow : 1; // browse or step 1 int new_selected = m_selecteddevice + step; - if (new_selected >= (int) m_devices.size()) { - if (((m_devices.size() - m_listmaxshow -1 < m_selecteddevice) && (step != 1)) || (m_selecteddevice != (m_devices.size() - 1))) + if (new_selected > (int) m_devices.size() - 1) { + if ((m_selecteddevice != m_devices.size() - 1)) new_selected = m_devices.size() - 1; - else if (((m_devices.size() / m_listmaxshow) + 1) * m_listmaxshow == m_devices.size() + m_listmaxshow) // last page has full entries - new_selected = 0; else - new_selected = ((step == (int) m_listmaxshow) && (new_selected < (int) (((m_devices.size() / m_listmaxshow)+1) * m_listmaxshow))) ? (m_devices.size() - 1) : 0; + new_selected = 0; } updateDeviceSelection(new_selected); } diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index e5fc17a1c..e05c02943 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -208,13 +208,11 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) if(getItemCount()!=0) { int step = ((int) msg == g_settings.key_pagedown) ? listmaxshow : 1; // browse or step 1 int new_selected = selected + step; - if (new_selected >= (int) getItemCount()) { - if (((getItemCount() - listmaxshow -1 < selected) && (step != 1)) || (selected != (getItemCount() - 1))) + if (new_selected > (int) getItemCount() - 1) { + if ((selected != getItemCount() - 1)) new_selected = getItemCount() - 1; - else if (((getItemCount() / listmaxshow) + 1) * listmaxshow == getItemCount() + listmaxshow) // last page has full entries - new_selected = 0; else - new_selected = ((step == (int) listmaxshow) && (new_selected < (int) (((getItemCount() / listmaxshow)+1) * listmaxshow))) ? (getItemCount() - 1) : 0; + new_selected = 0; } updateSelection(new_selected); }