mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-02 07:27:49 +00:00
kodi: Add upstream patch for skipping frames
This commit is contained in:
parent
acd078a83e
commit
a00e964543
@ -0,0 +1,65 @@
|
||||
From a30656bf2bee534836a984bbd488b1f16e01b9a0 Mon Sep 17 00:00:00 2001
|
||||
From: Jernej Skrabec <jernej.skrabec@siol.net>
|
||||
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();
|
Loading…
x
Reference in New Issue
Block a user