From 62fe516af4f23a73f1cdf4b2690da9f515ba0d1d Mon Sep 17 00:00:00 2001 From: BPanther Date: Sun, 28 Jan 2024 11:24:40 +0100 Subject: [PATCH] fix pip init (thx vanhofen) --- src/neutrino.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 6248164d3..483983c6c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2733,7 +2733,8 @@ TIMER_STOP("################################## after all ####################### if (g_info.hw_caps->can_pip) { CZapit::getInstance()->OpenPip(0); - pipVideoDecoder[0]->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); + if (pipVideoDecoder[0]) + pipVideoDecoder[0]->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, frameBuffer->getScreenWidth(true), frameBuffer->getScreenHeight(true)); usleep(100); CZapit::getInstance()->StopPip(0); } @@ -4738,20 +4739,25 @@ void CNeutrinoApp::StartAVInputPiP() { if (!g_info.hw_caps->can_pip) return; - if (!pipVideoDemux[0]) { + if (!pipVideoDemux[0]) + { pipVideoDemux[0] = new cDemux(1); pipVideoDemux[0]->Open(DMX_VIDEO_CHANNEL); - if (!pipVideoDecoder[0]) { - pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); - } } - pipVideoDemux[0]->SetSource(1, 2); - pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT) 1); - pipVideoDemux[0]->Start(); - pipVideoDecoder[0]->Start(0, 0, 0); - pipVideoDecoder[0]->open_AVInput_Device(); - pipVideoDecoder[0]->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, g_settings.screen_width, g_settings.screen_height); - pipVideoDecoder[0]->ShowPig(1); + + if (!pipVideoDecoder[0]) + pipVideoDecoder[0] = new cVideo(0, NULL, NULL, 1); + + if (pipVideoDecoder[0] && pipVideoDemux[0]) + { + pipVideoDemux[0]->SetSource(1, 2); + pipVideoDecoder[0]->SetStreamType((VIDEO_FORMAT) 1); + pipVideoDemux[0]->Start(); + pipVideoDecoder[0]->Start(0, 0, 0); + pipVideoDecoder[0]->open_AVInput_Device(); + pipVideoDecoder[0]->Pig(g_settings.pip_x, g_settings.pip_y, g_settings.pip_width, g_settings.pip_height, g_settings.screen_width, g_settings.screen_height); + pipVideoDecoder[0]->ShowPig(1); + } avinput_pip = true; }