From d0ea4ad62ee2391a74974852695d947e1eb7f67d Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 13 Jan 2013 21:52:37 +0100 Subject: [PATCH] neutrino-tell-the-user-if-no-frontend-is-found1.patch from neutrino-mp --- src/neutrino.cpp | 9 +++++++-- src/zapit/src/zapit.cpp | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 572961e7f..5ca12639c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1777,8 +1777,7 @@ TIMER_START(); ZapStart_arg.volume = g_settings.current_volume; /* create decoders, read channels */ - CZapit::getInstance()->Start(&ZapStart_arg); - + bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); // init audio settings audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); //audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); @@ -1796,6 +1795,12 @@ TIMER_START(); g_RCInput = new CRCInput(); + /* later on, we'll crash anyway, so tell about it. */ + if (! zapit_init) + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, + "Zapit initialization failed.\nThis is a fatal error, sorry.", + CMessageBox::mbrBack, CMessageBox::mbBack); + InitZapitClient(); g_Zapit->setStandby(false); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 896cb9f9d..a10ce3817 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2023,6 +2023,10 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg) CFEManager::getInstance()->Init(); live_fe = CFEManager::getInstance()->getFE(0); + + if (live_fe == NULL) /* no frontend found? */ + return false; + /* load configuration or set defaults if no configuration file exists */ video_mode = ZapStart_arg->video_mode; current_volume = ZapStart_arg->volume;