diff --git a/packages/mediacenter/kodi/patches/kodi-995.30-CDVDVideoCodecDRMPRIME-skip-frames-when-requested.patch b/packages/mediacenter/kodi/patches/kodi-995.30-CDVDVideoCodecDRMPRIME-skip-frames-when-requested.patch new file mode 100644 index 0000000000..da55f3ae2d --- /dev/null +++ b/packages/mediacenter/kodi/patches/kodi-995.30-CDVDVideoCodecDRMPRIME-skip-frames-when-requested.patch @@ -0,0 +1,65 @@ +From a30656bf2bee534836a984bbd488b1f16e01b9a0 Mon Sep 17 00:00:00 2001 +From: Jernej Skrabec +Date: Sun, 14 Mar 2021 08:40:19 +0100 +Subject: [PATCH] CDVDVideoCodecDRMPRIME: skip frames when requested + +--- + .../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp | 27 +++++++++++++++++++ + .../DVDCodecs/Video/DVDVideoCodecDRMPRIME.h | 2 +- + 2 files changed, 28 insertions(+), 1 deletion(-) + +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp +index 8024c20816ffe..b27db92b5f7d7 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp +@@ -517,6 +517,12 @@ void CDVDVideoCodecDRMPRIME::SetPictureParams(VideoPicture* pVideoPicture) + pVideoPicture->iFlags = 0; + pVideoPicture->iFlags |= m_pFrame->interlaced_frame ? DVP_FLAG_INTERLACED : 0; + pVideoPicture->iFlags |= m_pFrame->top_field_first ? DVP_FLAG_TOP_FIELD_FIRST : 0; ++ pVideoPicture->iFlags |= m_pFrame->data[0] ? 0 : DVP_FLAG_DROPPED; ++ ++ if (m_codecControlFlags & DVD_CODEC_CTRL_DROP) ++ { ++ pVideoPicture->iFlags |= DVP_FLAG_DROPPED; ++ } + + int64_t pts = m_pFrame->best_effort_timestamp; + pVideoPicture->pts = (pts == AV_NOPTS_VALUE) +@@ -590,3 +596,24 @@ CDVDVideoCodec::VCReturn CDVDVideoCodecDRMPRIME::GetPicture(VideoPicture* pVideo + + return VC_PICTURE; + } ++ ++void CDVDVideoCodecDRMPRIME::SetCodecControl(int flags) ++{ ++ m_codecControlFlags = flags; ++ ++ if (m_pCodecContext) ++ { ++ if ((flags & DVD_CODEC_CTRL_DROP_ANY) != 0) ++ { ++ m_pCodecContext->skip_frame = AVDISCARD_NONREF; ++ m_pCodecContext->skip_idct = AVDISCARD_NONREF; ++ m_pCodecContext->skip_loop_filter = AVDISCARD_NONREF; ++ } ++ else ++ { ++ m_pCodecContext->skip_frame = AVDISCARD_DEFAULT; ++ m_pCodecContext->skip_idct = AVDISCARD_DEFAULT; ++ m_pCodecContext->skip_loop_filter = AVDISCARD_DEFAULT; ++ } ++ } ++} +diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h +index 77d066c3d9caf..9d70893b70b83 100644 +--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h ++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.h +@@ -29,7 +29,7 @@ class CDVDVideoCodecDRMPRIME : public CDVDVideoCodec + CDVDVideoCodec::VCReturn GetPicture(VideoPicture* pVideoPicture) override; + const char* GetName() override { return m_name.c_str(); } + unsigned GetAllowedReferences() override { return 5; } +- void SetCodecControl(int flags) override { m_codecControlFlags = flags; } ++ void SetCodecControl(int flags) override; + + protected: + void Drain();