Added fix for mzbz#1678680

This commit is contained in:
Martin Stransky 2020-11-28 10:09:12 +01:00
parent fb48de5e23
commit f11a798b39
2 changed files with 81 additions and 3 deletions

View File

@ -1,9 +1,9 @@
# Set to true if it's going to be submitted as update.
%global release_build 0
%global release_build 1
%global debug_build 0
%global build_with_clang 0
%global build_with_asan 0
%global run_firefox_tests 1
%global run_firefox_tests 0
%global create_debuginfo 1
%global system_nss 1
@ -125,7 +125,7 @@ ExcludeArch: aarch64
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 83.0
Release: 9%{?pre_tag}%{?dist}
Release: 10%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -191,6 +191,7 @@ Patch416: mozilla-1673202.patch
Patch417: mozilla-1673313.patch
Patch418: mozilla-1556931-s390x-hidden-syms.patch
Patch419: mozilla-1885133.patch
Patch420: mozilla-1678680.patch
# Upstream patches from mozbz#1672944
Patch450: pw1.patch
@ -420,6 +421,7 @@ This package contains results of tests executed during build.
%patch453 -p1 -b .pw4
%patch454 -p1 -b .pw5
%patch455 -p1 -b .pw6
%patch420 -p1 -b .1678680
# VA-API fixes
%patch584 -p1 -b .firefox-disable-ffvpx-with-vapi
@ -996,6 +998,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Sat Nov 28 2020 Martin Stransky <stransky@redhat.com> - 83.0-10
- Added fix for mzbz#1678680
* Wed Nov 25 2020 Martin Stransky <stransky@redhat.com> - 83.0-9
- Added mochitest test files

73
mozilla-1678680.patch Normal file
View File

@ -0,0 +1,73 @@
changeset: 560838:7a5a1784b5d1
tag: tip
parent: 560835:7184fb5a42fb
user: Martin Stransky <stransky@redhat.com>
date: Fri Nov 27 17:29:07 2020 +0100
files: third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
description:
Bug 1678680 [PipeWire] Lock current_frame_ access as it can be used from multiple threads, r?dminor
Differential Revision: https://phabricator.services.mozilla.com/D98080
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
@@ -396,16 +396,17 @@ void BaseCapturerPipeWire::HandleBuffer(
DesktopSize video_size_prev = video_size_;
if (video_metadata_use_) {
video_size_ = DesktopSize(video_metadata->region.size.width,
video_metadata->region.size.height);
} else {
video_size_ = desktop_size_;
}
+ rtc::CritScope lock(&current_frame_lock_);
if (!current_frame_ ||
(video_metadata_use_ && !video_size_.equals(video_size_prev))) {
current_frame_ =
std::make_unique<uint8_t[]>
(video_size_.width() * video_size_.height() * kBytesPerPixel);
}
const int32_t dstStride = video_size_.width() * kBytesPerPixel;
@@ -872,16 +873,17 @@ void BaseCapturerPipeWire::Start(Callbac
}
void BaseCapturerPipeWire::CaptureFrame() {
if (portal_init_failed_) {
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return;
}
+ rtc::CritScope lock(&current_frame_lock_);
if (!current_frame_) {
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return;
}
DesktopSize frame_size = desktop_size_;
if (video_metadata_use_) {
frame_size = video_size_;
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
@@ -79,16 +79,17 @@ class BaseCapturerPipeWire : public Desk
guint sources_request_signal_id_ = 0;
guint start_request_signal_id_ = 0;
bool video_metadata_use_ = false;
DesktopSize video_size_;
DesktopSize desktop_size_ = {};
DesktopCaptureOptions options_ = {};
+ rtc::CriticalSection current_frame_lock_;
std::unique_ptr<uint8_t[]> current_frame_;
Callback* callback_ = nullptr;
bool portal_init_failed_ = false;
void InitPortal();
void InitPipeWire();