From e182adc94688ddfc8c73596136e7dfd325d84461 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:13:36 +0100 Subject: [PATCH] apply patch to fix sigsegv with video playing (https://bugs.chromium.org/p/chromium/issues/detail?id=1095962) [release 83.0.4103.116-3mamba;Mon Jun 29 2020] --- chromium-83.0.4103.116-ffmpeg-4.3.patch | 41 +++++++++++++++++++ ...ium-83.0.4103.116-fix-vaapi-on-intel.patch | 40 ++++++++++++++++++ chromium.spec | 23 +++++++++-- 3 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 chromium-83.0.4103.116-ffmpeg-4.3.patch create mode 100644 chromium-83.0.4103.116-fix-vaapi-on-intel.patch diff --git a/chromium-83.0.4103.116-ffmpeg-4.3.patch b/chromium-83.0.4103.116-ffmpeg-4.3.patch new file mode 100644 index 0000000..69f0229 --- /dev/null +++ b/chromium-83.0.4103.116-ffmpeg-4.3.patch @@ -0,0 +1,41 @@ +https://bugs.chromium.org/p/chromium/issues/detail?id=1095962 + +--- /media/base/media.cc ++++ /media/base/media.cc +@@ -2,6 +2,8 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include ++ + #include "media/base/media.h" + + #include "base/allocator/buildflags.h" +@@ -41,7 +43,7 @@ + + #if BUILDFLAG(USE_ALLOCATOR_SHIM) + // Remove allocation limit from ffmpeg, so calls go down to shim layer. +- av_max_alloc(0); ++ av_max_alloc(std::numeric_limits::max()); + #endif // BUILDFLAG(USE_ALLOCATOR_SHIM) + + #endif // BUILDFLAG(ENABLE_FFMPEG) +--- /third_party/ffmpeg/chromium/dllmain.cc ++++ /third_party/ffmpeg/chromium/dllmain.cc +@@ -3,6 +3,7 @@ + // found in the LICENSE file. + + #include ++#include + #include + #include + #include +@@ -28,7 +29,7 @@ + if (reason == DLL_PROCESS_ATTACH) { + DisableThreadLibraryCalls(instance); + // Remove allocation limit from ffmpeg, so calls go down to shim layer. +- av_max_alloc(0); ++ av_max_alloc(std::numeric_limits::max()); + // Enable OOM crashes in the shim for all malloc calls that fail. + _set_new_mode(1); + _set_new_handler(&OnNoMemory); diff --git a/chromium-83.0.4103.116-fix-vaapi-on-intel.patch b/chromium-83.0.4103.116-fix-vaapi-on-intel.patch new file mode 100644 index 0000000..73281f4 --- /dev/null +++ b/chromium-83.0.4103.116-fix-vaapi-on-intel.patch @@ -0,0 +1,40 @@ +From 9ff06536caf7ea51aad9fd2bb649c858eaf7ee84 Mon Sep 17 00:00:00 2001 +From: Akarshan Biswas +Date: Sat, 26 Oct 2019 10:06:30 +0530 +Subject: [PATCH] Move offending function to chromeos only + +--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc ++++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc +@@ -66,6 +66,7 @@ void ReportToUMA(VAVDADecoderFailure fai + VAVDA_DECODER_FAILURES_MAX + 1); + } + ++#if defined(OS_ANDROID) || defined(OS_CHROMEOS) + // Returns true if the CPU is an Intel Gemini Lake or later (including Kaby + // Lake) Cpu platform id's are referenced from the following file in kernel + // source arch/x86/include/asm/intel-family.h +@@ -78,6 +79,7 @@ bool IsGeminiLakeOrLater() { + cpuid.model() >= kGeminiLakeModelId; + return is_geminilake_or_later; + } ++#endif + + } // namespace + +@@ -1155,6 +1157,8 @@ VaapiVideoDecodeAccelerator::DecideBuffe + if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT) + return BufferAllocationMode::kNormal; + ++#if defined(OS_ANDROID) || defined(OS_CHROMEOS) ++ // Move this to chromeOs only as it is causing problem in some intel linux drivers + // On Gemini Lake, Kaby Lake and later we can pass to libva the client's + // PictureBuffers to decode onto, which skips the use of the Vpp unit and its + // associated format reconciliation copy, avoiding all internal buffer +@@ -1171,6 +1175,7 @@ VaapiVideoDecodeAccelerator::DecideBuffe + num_extra_pics_ = 3; + return BufferAllocationMode::kNone; + } ++#endif + + // If we're here, we have to use the Vpp unit and allocate buffers for + // |decoder_|; usually we'd have to allocate the |decoder_|s diff --git a/chromium.spec b/chromium.spec index 6b5f848..bd48955 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1,7 +1,7 @@ Name: chromium Epoch: 3 -Version: 83.0.4103.97 -Release: 1mamba +Version: 83.0.4103.116 +Release: 3mamba Summary: An open-source browser project that aims to build a safer, faster, and more stable way to experience the web Group: Graphical Desktop/Applications/Internet Vendor: openmamba @@ -66,7 +66,9 @@ Patch60: chromium-83.0.4103.61-std-numeric_limits-is-defined-in-limits.pat Patch61: chromium-83.0.4103.61-make-some-of-blink-custom-iterators-STL-compatible.patch Patch62: chromium-83.0.4103.61-nclude-memory-header-to-get-the-definition-of-std-u.patch Patch63: chromium-83.0.4103.61-v8-remove-soon-to-be-removed-getAllFieldPositions.patch -Patch64: chromium-83.0.4103.83-avoid-double-destruction-of-ServiceWorkerObjectHost.patch +Patch64: chromium-83.0.4103.83-avoid-double-destruction-of-ServiceWorkerObjectHost.patch +Patch65: chromium-83.0.4103.116-fix-vaapi-on-intel.patch +Patch66: chromium-83.0.4103.116-ffmpeg-4.3.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -190,6 +192,8 @@ Chromium is an open-source browser project that aims to build a safer, faster, a %patch62 -p1 %patch63 -p1 -d v8 %patch64 -p1 +%patch65 -p1 +%patch66 -p1 # Allow building against system libraries in official builds sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ @@ -305,6 +309,7 @@ chromium_conf=( 'use_custom_libcxx=false' 'enable_hangout_services_extension=true' 'enable_widevine=true' + 'use_vaapi=true' 'enable_nacl=false' 'enable_swiftshader=false' 'google_api_key="AIzaSyBT3wXwxmFuUQcyeMyp0MbHHhhFwNfWKTc"' @@ -464,6 +469,18 @@ ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver %{_mandir}/man1/chromium.1* %changelog +* Mon Jun 29 2020 Silvan Calarco 83.0.4103.116-3mamba +- apply patch to fix sigsegv with video playing (https://bugs.chromium.org/p/chromium/issues/detail?id=1095962) + +* Wed Jun 24 2020 Silvan Calarco 83.0.4103.116-2mamba +- added use-vaapi=true and fix-vaapi-on-intel patch to fix crashing while playing videos + +* Tue Jun 23 2020 Automatic Build System 83.0.4103.116-1mamba +- automatic version update by autodist + +* Tue Jun 16 2020 Automatic Build System 83.0.4103.106-1mamba +- automatic version update by autodist + * Thu Jun 04 2020 Automatic Build System 83.0.4103.97-1mamba - automatic version update by autodist