Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7fd17a

Browse files
authored
chore: cherry-pick a0a48e0132bc from chromium (#22983)
1 parent b68f899 commit c7fd17a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

patches/chromium/.patches

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ streams_convert_state_dchecks_to_checks.patch
101101
-_point_usrsctp_to_a68325e7d9ed844cc84ec134192d788586ea6cc1.patch
102102
audiocontext_haspendingactivity_unless_it_s_closed.patch
103103
protect_automatic_pull_handlers_with_mutex.patch
104+
mojovideoencodeacceleratorservice_handle_potential_later.patch
104105
speculative_fix_for_crashes_in_filechooserimpl.patch
105106
reland_sequentialise_access_to_callbacks_in.patch
106107
handle_err_cache_race_in_dodoneheadersaddtoentrycomplete.patch
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: Miguel Casas <[email protected]>
3+
Date: Thu, 5 Mar 2020 19:42:53 +0000
4+
Subject: MojoVideoEncodeAcceleratorService: handle potential later
5+
Initialize()
6+
7+
This CL fixes a potential Initialize()-after-Initialize() of the said
8+
service, as described in the bug, following the suggestion in #c11.
9+
10+
Bug: 1056222
11+
Change-Id: Idd951d3f0bee62b94382ffe80e4e6b3cef33e6d9
12+
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090031
13+
Commit-Queue: Miguel Casas <[email protected]>
14+
Commit-Queue: Chrome Cunningham <[email protected]>
15+
Auto-Submit: Miguel Casas <[email protected]>
16+
Reviewed-by: danakj <[email protected]>
17+
Reviewed-by: Chrome Cunningham <[email protected]>
18+
Cr-Commit-Position: refs/heads/master@{#747376}
19+
20+
diff --git a/media/mojo/services/mojo_video_encode_accelerator_service.cc b/media/mojo/services/mojo_video_encode_accelerator_service.cc
21+
index 03d2d30914e1b5dfcebe0df8aaca3d314ac94d42..be881b0de4f968bd74aef68a052bbed37afa78c6 100644
22+
--- a/media/mojo/services/mojo_video_encode_accelerator_service.cc
23+
+++ b/media/mojo/services/mojo_video_encode_accelerator_service.cc
24+
@@ -48,11 +48,16 @@ void MojoVideoEncodeAcceleratorService::Initialize(
25+
InitializeCallback success_callback) {
26+
DVLOG(1) << __func__ << " " << config.AsHumanReadableString();
27+
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
28+
- DCHECK(!encoder_);
29+
DCHECK(config.input_format == PIXEL_FORMAT_I420 ||
30+
config.input_format == PIXEL_FORMAT_NV12)
31+
<< "Only I420 or NV12 format supported";
32+
33+
+ if (encoder_) {
34+
+ DLOG(ERROR) << __func__ << " VEA is already initialized";
35+
+ std::move(success_callback).Run(false);
36+
+ return;
37+
+ }
38+
+
39+
if (!client) {
40+
DLOG(ERROR) << __func__ << "null |client|";
41+
std::move(success_callback).Run(false);

0 commit comments

Comments
 (0)