Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cherry-pick 3fbd1dca6a4d from libvpx #40025

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion patches/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@

"src/electron/patches/skia": "src/third_party/skia",

"src/electron/patches/libwebp": "src/third_party/libwebp/src"
"src/electron/patches/libwebp": "src/third_party/libwebp/src",

"src/electron/patches/libvpx": "src/third_party/libvpx/source/libvpx"
}
1 change: 1 addition & 0 deletions patches/libvpx/.patches
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cherry-pick-3fbd1dca6a4d.patch
27 changes: 27 additions & 0 deletions patches/libvpx/cherry-pick-3fbd1dca6a4d.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: James Zern <jzern@google.com>
Date: Mon, 25 Sep 2023 18:55:59 -0700
Subject: VP8: disallow thread count changes

Currently allocations are done at encoder creation time. Going from
threaded to non-threaded would cause a crash.

Bug: chromium:1486441
Change-Id: Ie301c2a70847dff2f0daae408fbef1e4d42e73d4

diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 4bbeadef013c8e0a1ae8d9241b90489e37ab36d7..148a16cc493d109fee859a9628f58e7361b02e0d 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1443,6 +1443,11 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
last_h = cpi->oxcf.Height;
prev_number_of_layers = cpi->oxcf.number_of_layers;

+ if (cpi->initial_width) {
+ // TODO(https://crbug.com/1486441): Allow changing thread counts; the
+ // allocation is done once in vp8_create_compressor().
+ oxcf->multi_threaded = cpi->oxcf.multi_threaded;
+ }
cpi->oxcf = *oxcf;

switch (cpi->oxcf.Mode) {