From 71a670d8217f425f66c8afe032dd5445bd3f60d7 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 10 May 2021 22:50:17 +0200 Subject: [PATCH] - fix compiler warning and segfault in avinput_pip handling Conflicts: src/neutrino.cpp Signed-off-by: Thilo Graf --- src/neutrino.cpp | 37 ++++++++++++++++++------------------- src/neutrino.h | 2 ++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index cbe955f91..7b9d59b88 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -195,7 +195,6 @@ extern cVideo * videoDecoder; #ifdef ENABLE_PIP extern cVideo *pipDecoder; extern cDemux *pipDemux; -static bool avinput_pip = false; #endif extern cDemux *videoDemux; extern cAudio * audioDecoder; @@ -276,6 +275,11 @@ CNeutrinoApp::CNeutrinoApp() channels_init = false; channelList_allowed = true; channelList_painted = false; + + +#ifdef ENABLE_PIP + avinput_pip = false; +#endif } /*------------------------------------------------------------------------------------- @@ -3358,16 +3362,13 @@ void CNeutrinoApp::RealRun() ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_BOXMODE12_NOT_ACTIVATED, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_ERROR); else { - if (!avinput_pip) { - if (CZapit::getInstance()->GetPipChannelID()) - CZapit::getInstance()->StopPip(); + if (CZapit::getInstance()->GetPipChannelID()) + CZapit::getInstance()->StopPip(); + + if (!avinput_pip) StartAVInputPiP(); - } else { - if (CZapit::getInstance()->GetPipChannelID()) - CZapit::getInstance()->StopPip(); - else - StopAVInputPiP(); - } + else + StopAVInputPiP(); } } else if (msg == (neutrino_msg_t) g_settings.key_pip_setup) { @@ -5137,16 +5138,14 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) #ifdef ENABLE_PIP else if (actionKey=="avinput_pip") { - if (!avinput_pip) { - if (CZapit::getInstance()->GetPipChannelID()) - CZapit::getInstance()->StopPip(); + if (CZapit::getInstance()->GetPipChannelID()) + CZapit::getInstance()->StopPip(); + + if (!avinput_pip) StartAVInputPiP(); - } else { - if (CZapit::getInstance()->GetPipChannelID()) - CZapit::getInstance()->StopPip(); - else - StopAVInputPiP(); - } + else + StopAVInputPiP(); + returnval = menu_return::RETURN_EXIT_ALL; } #endif diff --git a/src/neutrino.h b/src/neutrino.h index b7a42b3d0..f2a775040 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -169,9 +169,11 @@ public: void channelsInit(bool bOnly = false); int run(int argc, char **argv); +#ifdef ENABLE_PIP bool avinput_pip; void StartAVInputPiP(); void StopAVInputPiP(); +#endif //callback stuff only.... int exec(CMenuTarget* parent, const std::string & actionKey);