From 1b6c52f8e7f8e32dc6d93acc5a0651c865d34fbc Mon Sep 17 00:00:00 2001 From: BPanther Date: Sat, 7 Oct 2023 00:40:42 +0200 Subject: [PATCH] fix pip avinput (ext hdmi) --- src/neutrino.cpp | 21 ++++++++++++++++----- src/zapit/src/zapit.cpp | 4 ++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f75b9ef36..b44a2370e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4750,13 +4750,24 @@ void CNeutrinoApp::StartAVInputPiP() { } void CNeutrinoApp::StopAVInputPiP() { - if (!g_info.hw_caps->can_pip) + if (!g_info.hw_caps->can_pip || !avinput_pip) return; - pipVideoDecoder[0]->ShowPig(0); - pipVideoDemux[0]->Stop(); - pipVideoDecoder[0]->Stop(); - pipVideoDecoder[0]->close_AVInput_Device(); + if (pipVideoDemux[0]) + { + pipVideoDemux[0]->Stop(); + delete pipVideoDemux[0]; + pipVideoDemux[0] = NULL; + } + if (pipVideoDecoder[0]) + { + pipVideoDecoder[0]->ShowPig(0); + pipVideoDecoder[0]->Stop(); + pipVideoDecoder[0]->close_AVInput_Device(); + pipVideoDecoder[0]->closeDevice(); + delete pipVideoDecoder[0]; + pipVideoDecoder[0] = NULL; + } avinput_pip = false; } #endif diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 4dd967c9b..90d3cc596 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -703,6 +703,10 @@ bool CZapit::StartPip(const t_channel_id channel_id, int pip) if (!g_info.hw_caps->can_pip) return false; + if (CNeutrinoApp::getInstance()->avinput_pip) { + StopPip(0); + } + pipVideoDecoder[pip] = new cVideo(0, NULL, NULL, pip+1); pipVideoDecoder[pip]->ShowPig(0); pipVideoDemux[pip] = new cDemux(pip+1);