diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 54a8d6f950d..d6371b7621c 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -24358,7 +24358,19 @@ msgctxt "#39208"
msgid "Starfish is the hardware video decoder for LG's webOS. Disable it for troubleshooting or testing."
msgstr ""
-#empty strings from id 39209 to 39999
+#. Title of Dolby Vision level 5 metadata zero override setting
+#: system/settings/settings.xml
+msgctxt "#39209"
+msgid "Dolby Vision: Override level 5 metadata to zero"
+msgstr ""
+
+#. Help text for setting "Dolby Vision: Override level 5 metadata to zero" of label #39209
+#: system/settings/settings.xml
+msgctxt "#39210"
+msgid "If enabled, Dolby Vision files will have level 5 (active area) metadata overridden to zero offsets. Enable if your display has issues with incorrectly cropped image in Dolby Vision playback."
+msgstr ""
+
+#empty strings from id 39211 to 39999
# 40000 to 40800 are reserved for Video Versions feature
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index 770aec5b33b..335e87728cb 100755
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -241,6 +241,25 @@
false
+
+
+
+ HAS_MEDIACODEC
+ HAVE_WEBOS
+
+
+
+
+
+
+ HAVE_WEBOS
+
+
+
+ 2
+ false
+
+
diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
index ed49e83018b..a1ab07c2722 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp
@@ -500,10 +500,12 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
bool convertDovi{false};
bool removeDovi{false};
bool removeHdr10Plus{false};
+ bool doviZeroLevel5{false};
if (settings)
{
convertDovi = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
+ doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
const std::shared_ptr allowedHdrFormatsSetting(
std::dynamic_pointer_cast(
@@ -600,6 +602,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
{
m_bitstream->SetRemoveDovi(removeDovi);
m_bitstream->SetRemoveHdr10Plus(removeHdr10Plus);
+ m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
// Only set for profile 7, container hint allows to skip parsing unnecessarily
if (m_hints.dovi.dv_profile == 7)
diff --git a/xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp b/xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp
index 58a4af568cf..b9b8573d9ed 100644
--- a/xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp
+++ b/xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp
@@ -846,6 +846,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
const std::shared_ptr settings = CServiceBroker::GetSettingsComponent()->GetSettings();
const bool convertDovi =
hint.dovi.el_present_flag || settings->GetBool(CSettings::SETTING_VIDEOPLAYER_CONVERTDOVI);
+ const bool doviZeroLevel5 = settings->GetBool(CSettings::SETTING_VIDEOPLAYER_DOVIZEROLEVEL5);
const std::shared_ptr allowedHdrFormatsSetting(std::dynamic_pointer_cast(
settings->GetSetting(CSettings::SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS)));
@@ -864,6 +865,7 @@ void CMediaPipelineWebOS::SetupBitstreamConverter(CDVDStreamInfo& hint)
if (hint.codec == AV_CODEC_ID_HEVC)
{
m_bitstream->SetRemoveDovi(removeDovi);
+ m_bitstream->SetDoviZeroLevel5(doviZeroLevel5);
// webOS doesn't support HDR10+ and it can cause issues
m_bitstream->SetRemoveHdr10Plus(true);
diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h
index f70a19900c4..1e7c06df8dd 100644
--- a/xbmc/settings/Settings.h
+++ b/xbmc/settings/Settings.h
@@ -137,6 +137,7 @@ public:
static constexpr auto SETTING_VIDEOPLAYER_SUPPORTMVC = "videoplayer.supportmvc";
static constexpr auto SETTING_VIDEOPLAYER_CONVERTDOVI = "videoplayer.convertdovi";
static constexpr auto SETTING_VIDEOPLAYER_ALLOWEDHDRFORMATS = "videoplayer.allowedhdrformats";
+ static constexpr auto SETTING_VIDEOPLAYER_DOVIZEROLEVEL5 = "videoplayer.dovizerolevel5";
static constexpr auto SETTING_VIDEOPLAYER_QUEUETIMESIZE = "videoplayer.queuetimesize";
static constexpr auto SETTING_VIDEOPLAYER_QUEUEDATASIZE = "videoplayer.queuedatasize";
static constexpr auto SETTING_MYVIDEOS_SELECTACTION = "myvideos.selectaction";
diff --git a/xbmc/utils/BitstreamConverter.h b/xbmc/utils/BitstreamConverter.h
index 8620cb13b76..09ab72860c9 100644
--- a/xbmc/utils/BitstreamConverter.h
+++ b/xbmc/utils/BitstreamConverter.h
@@ -106,6 +106,7 @@ public:
void SetConvertDovi(bool value) { m_convert_dovi = value; }
void SetRemoveDovi(bool value) { m_removeDovi = value; }
void SetRemoveHdr10Plus(bool value) { m_removeHdr10Plus = value; }
+ void SetDoviZeroLevel5(bool value) { m_setDoviZeroLevel5 = value; }
static bool mpeg2_sequence_header(const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence);