Skip to content

Commit 3fbd1dc

Browse files
committed
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
1 parent af6dedd commit 3fbd1dc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: test/encode_api_test.cc

-4
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,6 @@ TEST(EncodeAPI, ConfigResizeChangeThreadCount) {
370370

371371
for (const auto *iface : kCodecIfaces) {
372372
SCOPED_TRACE(vpx_codec_iface_name(iface));
373-
if (!IsVP9(iface)) {
374-
GTEST_SKIP() << "TODO(https://crbug.com/1486441) remove this condition "
375-
"after VP8 is fixed.";
376-
}
377373
for (int i = 0; i < (IsVP9(iface) ? 2 : 1); ++i) {
378374
vpx_codec_enc_cfg_t cfg = {};
379375
struct Encoder {

Diff for: vp8/encoder/onyx_if.c

+5
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,11 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
14471447
last_h = cpi->oxcf.Height;
14481448
prev_number_of_layers = cpi->oxcf.number_of_layers;
14491449

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

14521457
switch (cpi->oxcf.Mode) {

0 commit comments

Comments
 (0)