- fix compiler warning and segfault in avinput_pip handling

Conflicts:
	src/neutrino.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-05-10 22:50:17 +02:00
committed by Thilo Graf
parent f27ff4563c
commit 71a670d821
2 changed files with 20 additions and 19 deletions

View File

@@ -195,7 +195,6 @@ extern cVideo * videoDecoder;
#ifdef ENABLE_PIP #ifdef ENABLE_PIP
extern cVideo *pipDecoder; extern cVideo *pipDecoder;
extern cDemux *pipDemux; extern cDemux *pipDemux;
static bool avinput_pip = false;
#endif #endif
extern cDemux *videoDemux; extern cDemux *videoDemux;
extern cAudio * audioDecoder; extern cAudio * audioDecoder;
@@ -276,6 +275,11 @@ CNeutrinoApp::CNeutrinoApp()
channels_init = false; channels_init = false;
channelList_allowed = true; channelList_allowed = true;
channelList_painted = false; 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); ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_BOXMODE12_NOT_ACTIVATED, CMsgBox::mbrOk, CMsgBox::mbOk, NEUTRINO_ICON_ERROR);
else else
{ {
if (!avinput_pip) { if (CZapit::getInstance()->GetPipChannelID())
if (CZapit::getInstance()->GetPipChannelID()) CZapit::getInstance()->StopPip();
CZapit::getInstance()->StopPip();
if (!avinput_pip)
StartAVInputPiP(); StartAVInputPiP();
} else { else
if (CZapit::getInstance()->GetPipChannelID()) StopAVInputPiP();
CZapit::getInstance()->StopPip();
else
StopAVInputPiP();
}
} }
} }
else if (msg == (neutrino_msg_t) g_settings.key_pip_setup) { 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 #ifdef ENABLE_PIP
else if (actionKey=="avinput_pip") { else if (actionKey=="avinput_pip") {
if (!avinput_pip) { if (CZapit::getInstance()->GetPipChannelID())
if (CZapit::getInstance()->GetPipChannelID()) CZapit::getInstance()->StopPip();
CZapit::getInstance()->StopPip();
if (!avinput_pip)
StartAVInputPiP(); StartAVInputPiP();
} else { else
if (CZapit::getInstance()->GetPipChannelID()) StopAVInputPiP();
CZapit::getInstance()->StopPip();
else
StopAVInputPiP();
}
returnval = menu_return::RETURN_EXIT_ALL; returnval = menu_return::RETURN_EXIT_ALL;
} }
#endif #endif

View File

@@ -169,9 +169,11 @@ public:
void channelsInit(bool bOnly = false); void channelsInit(bool bOnly = false);
int run(int argc, char **argv); int run(int argc, char **argv);
#ifdef ENABLE_PIP
bool avinput_pip; bool avinput_pip;
void StartAVInputPiP(); void StartAVInputPiP();
void StopAVInputPiP(); void StopAVInputPiP();
#endif
//callback stuff only.... //callback stuff only....
int exec(CMenuTarget* parent, const std::string & actionKey); int exec(CMenuTarget* parent, const std::string & actionKey);