Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Unified Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2029373002: media: AVDA::QueueInput/DequeueOutput bail if state_ is invalid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/android_video_decode_accelerator.cc
diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc
index dbd07eb19919a4bdcce4cbc2e227c91069b46b3f..dab6844a00c0c64ff1fe8d8897f6c1194c3231e1 100644
--- a/media/gpu/android_video_decode_accelerator.cc
+++ b/media/gpu/android_video_decode_accelerator.cc
@@ -584,12 +584,14 @@ bool AndroidVideoDecodeAccelerator::QueueInput() {
DCHECK(thread_checker_.CalledOnValidThread());
TRACE_EVENT0("media", "AVDA::QueueInput");
base::AutoReset<bool> auto_reset(&defer_errors_, true);
+ if (state_ == ERROR || state_ == WAITING_FOR_CODEC ||
+ state_ == WAITING_FOR_KEY) {
+ return false;
+ }
if (bitstreams_notified_in_advance_.size() > kMaxBitstreamsNotifiedInAdvance)
return false;
if (pending_bitstream_records_.empty())
return false;
- if (state_ == WAITING_FOR_KEY)
- return false;
int input_buf_index = pending_input_buf_index_;
@@ -716,11 +718,12 @@ bool AndroidVideoDecodeAccelerator::DequeueOutput() {
DCHECK(thread_checker_.CalledOnValidThread());
TRACE_EVENT0("media", "AVDA::DequeueOutput");
base::AutoReset<bool> auto_reset(&defer_errors_, true);
+ if (state_ == ERROR || state_ == WAITING_FOR_CODEC)
+ return false;
if (picturebuffers_requested_ && output_picture_buffers_.empty())
return false;
-
if (!output_picture_buffers_.empty() && free_picture_ids_.empty()) {
- // Don't have any picture buffer to send. Need to wait more.
+ // Don't have any picture buffer to send. Need to wait.
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698