From 49cde01c0e015455173ea523d97831a0e5b9c986 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Mon, 15 Feb 2021 11:43:26 -0800
Subject: [PATCH 1/2] [hack] force YUYV output from v4l2

---
 .../DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp          | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
index 8024c20816..173c67f103 100644
--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp
@@ -327,6 +327,16 @@ bool CDVDVideoCodecDRMPRIME::Open(CDVDStreamInfo& hints, CDVDCodecOptions& optio
   for (auto&& option : options.m_keys)
     av_opt_set(m_pCodecContext, option.m_name.c_str(), option.m_value.c_str(), 0);
 
+  int ret = av_opt_set_pixel_fmt(m_pCodecContext, "pixel_format", AV_PIX_FMT_YUYV422,
+                                 AV_OPT_SEARCH_CHILDREN);
+  if (ret < 0)
+  {
+    std::array<char, AV_ERROR_MAX_STRING_SIZE> buffer;
+    av_make_error_string(buffer.data(), buffer.size(), ret);
+    CLog::Log(LOGDEBUG, "CDVDVideoCodecDRMPRIME::{} - unable to set pixelformat: {}", __FUNCTION__,
+              buffer.data());
+  }
+
   if (avcodec_open2(m_pCodecContext, pCodec, nullptr) < 0)
   {
     CLog::Log(LOGINFO, "CDVDVideoCodecDRMPRIME::{} - unable to open codec", __FUNCTION__);
-- 
2.29.2

