diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index ed42473a3..0c4234b8e 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -235,8 +235,10 @@ int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int setOsdResolutions(); if (fullHdAvailable()) { - screeninfo.xres_virtual=screeninfo.xres=nxRes; - screeninfo.yres_virtual=screeninfo.yres=nyRes; + screeninfo.xres=nxRes; + screeninfo.yres=nyRes; + screeninfo.xres_virtual=nxRes; + screeninfo.yres_virtual=nyRes*2; screeninfo.height=0; screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 12398f9f8..26f910e45 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -546,6 +546,7 @@ void MI_MOVIE_INFO::clear(void) marked = false; delAsk = true; + source = UNKNOWN; } bool CMovieInfo::loadFile(CFile &file, std::string &buffer) diff --git a/src/gui/osd_helpers.cpp b/src/gui/osd_helpers.cpp index c06563f5a..c4c78ca95 100644 --- a/src/gui/osd_helpers.cpp +++ b/src/gui/osd_helpers.cpp @@ -62,7 +62,13 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo modeNew = OSDMODE_720; idx = frameBuffer->getIndexOsdResolution(modeNew); resetOsd = (modeNew != getOsdResolution()) ? true : false; - +#if 1 + printf(">>>>>[%s:%d] osd mode: %s => %s, automode: %s, forceOsdReset: %s\n", __func__, __LINE__, + (g_settings.osd_resolution == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080", + (modeNew == OSDMODE_720)?"OSDMODE_720":"OSDMODE_1080", + (automode)?"true":"false", + (forceOsdReset)?"true":"false"); +#endif if (forceOsdReset) resetOsd = true; @@ -111,25 +117,12 @@ void COsdHelpers::changeOsdResolution(uint32_t mode, bool automode/*=false*/, bo } } } - -void COsdHelpers::resetOsdResolution(int newSystem) -{ - int videoSystem = getVideoSystem(); - if ((isVideoSystem1080(videoSystem)) && (!isVideoSystem1080(newSystem))) { - CFrameBuffer::getInstance()->setMode(1280, 720, 32); - } -} #else void COsdHelpers::changeOsdResolution(uint32_t, bool, bool) { } - -void COsdHelpers::resetOsdResolution(int) -{ -} #endif - int COsdHelpers::isVideoSystem1080(int res) { if ((res == VIDEO_STD_1080I60) || @@ -181,3 +174,44 @@ uint32_t COsdHelpers::getOsdResolution() } return 0; } + +#define DEBUGINFO_SETVIDEOSYSTEM + +int COsdHelpers::setVideoSystem(int newSystem, bool remember/* = true*/) +{ + if ((newSystem < 0) || (newSystem > VIDEO_STD_MAX)) + return -1; + + if (newSystem == getVideoSystem()) + return 0; + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + int fd = CFrameBuffer::getInstance()->getFileHandle(); + fb_var_screeninfo var; + fb_fix_screeninfo fix; + + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] before SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + int ret = videoDecoder->SetVideoSystem(newSystem, remember); + +#ifdef DEBUGINFO_SETVIDEOSYSTEM + ioctl(fd, FBIOGET_VSCREENINFO, &var); + ioctl(fd, FBIOGET_FSCREENINFO, &fix); + printf(">>>>>[%s - %s:%d] after SetVideoSystem:\n" + " var.xres : %4d, var.yres : %4d, var.yres_virtual: %4d\n" + " fix.line_length : %4d, fix.smem_len: %d Byte\n", + __path_file__, __func__, __LINE__, + var.xres, var.yres, var.yres_virtual, + fix.line_length, fix.smem_len); +#endif + + return ret; +} diff --git a/src/gui/osd_helpers.h b/src/gui/osd_helpers.h index d2c735e50..9c78886f0 100644 --- a/src/gui/osd_helpers.h +++ b/src/gui/osd_helpers.h @@ -19,10 +19,10 @@ class COsdHelpers int g_settings_osd_resolution_save; void changeOsdResolution(uint32_t mode, bool automode=false, bool forceOsdReset=false); - void resetOsdResolution(int newSystem); int isVideoSystem1080(int res); int getVideoSystem(); uint32_t getOsdResolution(); + int setVideoSystem(int newSystem, bool remember = true); }; diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 739efb7a5..742ffa733 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -525,9 +525,8 @@ void CVideoSettings::setVideoSettings() void CVideoSettings::setupVideoSystem(bool do_ask) { printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__); - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); //FIXME - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); //FIXME + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); if (do_ask) { @@ -537,9 +536,8 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO) != CMsgBox::mbrYes) { g_settings.video_Mode = prev_video_mode; - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); } else prev_video_mode = g_settings.video_Mode; @@ -725,9 +723,8 @@ void CVideoSettings::nextMode(void) else if(res == messages_return::cancel_info) { g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key; //CVFD::getInstance()->ShowText(text); - COsdHelpers::getInstance()->resetOsdResolution(g_settings.video_Mode); - videoDecoder->SetVideoSystem(g_settings.video_Mode); - COsdHelpers::getInstance()->changeOsdResolution(0, true, true); + COsdHelpers::getInstance()->setVideoSystem(g_settings.video_Mode); + COsdHelpers::getInstance()->changeOsdResolution(0, true, false); //return; disp_cur = 1; } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index bc364fd9f..48921105b 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -103,7 +103,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t //set result if (Default_result != mbrNone) result = default_result = Default_result; - + else + result = mbrNone; //add and initialize footer buttons with required buttons and basic properties if (ShowButtons > -1) mb_show_button = ShowButtons; @@ -275,53 +276,45 @@ int CMsgBox::exec() { scroll_down(); } - else if (msg){ - //***navi buttons for button selection*** - if(msg==CRCInput::RC_right || msg==CRCInput::RC_left) - { - if(msg==CRCInput::RC_right){ - ccw_footer->setSelectedButton(selected+1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - if(msg==CRCInput::RC_left){ - ccw_footer->setSelectedButton(selected-1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - selected = ccw_footer->getSelectedButton(); + //***navi buttons for button selection*** + else if(msg == CRCInput::RC_right || msg == CRCInput::RC_left) + { + if (msg == CRCInput::RC_right) + ccw_footer->setSelectedButton(selected+1); + else + ccw_footer->setSelectedButton(selected-1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + selected = ccw_footer->getSelectedButton(); - //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** - if (ccw_footer->getButtonChainObject()->size()>1) - refreshFoot(); + //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** + if (ccw_footer->getButtonChainObject()->size()>1) + refreshFoot(); - //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** - if (timeout > 0){ - timeout_pb->setValues(0, timeout); - timeoutEnd = CRCInput::calcTimeoutEnd(timeout); - } + //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** + if (timeout > 0) { + timeout_pb->setValues(0, timeout); + timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + } + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); + } + + //***action buttons without preselection*** + for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ + CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); + if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ + result = (msg_result_t)btn_action->getButtonResult(); dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - } - - //***action buttons without preselection*** - for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ - CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); - if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ - result = (msg_result_t)btn_action->getButtonResult(); - dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - loop = false; - } - } - //***action button ok with preselected button*** - if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ - result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { - CNeutrinoApp::getInstance()->handleMsg(msg, data); - } - //***ignore*** - else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ - // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! - } + } + //***action button ok with preselected button*** + if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ + result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); + loop = false; + } + //***ignore*** + else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ + // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 093a4c05d..4bef718c4 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3241,14 +3241,12 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; if (!frameBufferInitialized) { - coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); + coh->setVideoSystem(videoSystem, false); return messages_return::handled; } - coh->resetOsdResolution(videoSystem); - videoDecoder->SetVideoSystem(videoSystem, false); - coh->changeOsdResolution(0, true, true); + coh->setVideoSystem(videoSystem, false); + coh->changeOsdResolution(0, true, false); return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { diff --git a/src/system/ytcache.cpp b/src/system/ytcache.cpp index 0f04358f4..66b52832d 100644 --- a/src/system/ytcache.cpp +++ b/src/system/ytcache.cpp @@ -70,7 +70,7 @@ std::string cYTCache::getName(MI_MOVIE_INFO *mi, std::string ext) case MI_MOVIE_INFO::NK: return g_settings.downloadcache_dir + "/nk-" + mi->ytid + "." + ext; default: - return ""; + return g_settings.downloadcache_dir + "/error-" + mi->ytid + "." + ext;; } } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 8cebb5fd2..e0cd7d42f 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -523,7 +523,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { dvbsub_stop(); - if (current_channel->getChannelID() == newchannel->getChannelID() && !newchannel->getScriptName().empty()){ + if (current_channel && current_channel->getChannelID() == newchannel->getChannelID() && !newchannel->getScriptName().empty()){ INFO("[zapit] stop rezap to channel %s id %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID()); return true; } @@ -1723,7 +1723,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); - videoDecoder->SetVideoSystem(msg.val); + COsdHelpers::getInstance()->setVideoSystem(msg.val); COsdHelpers::getInstance()->changeOsdResolution(0, true); CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; @@ -2483,7 +2483,7 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) audioDecoder = cAudio::GetDecoder(0); videoDecoder->SetDemux(videoDemux); - videoDecoder->SetVideoSystem(video_mode); + COsdHelpers::getInstance()->setVideoSystem(video_mode); uint32_t osd_resolution = ZapStart_arg->osd_resolution; COsdHelpers::getInstance()->changeOsdResolution(osd_resolution); videoDecoder->Standby(false);