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

Unified Diff: content/common/gpu/media/omx_video_decode_accelerator.cc

Issue 10961059: Correctly decrement OmxVideoDecodeAccelerator::output_buffers_at_component_ during Reset/Destroy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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: content/common/gpu/media/omx_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/omx_video_decode_accelerator.cc b/content/common/gpu/media/omx_video_decode_accelerator.cc
index bef07c0f060643f5795afc2ac7a375d475040c18..9210fa965c8dac32bf738abcd0b90b22666ac613 100644
--- a/content/common/gpu/media/omx_video_decode_accelerator.cc
+++ b/content/common/gpu/media/omx_video_decode_accelerator.cc
@@ -818,14 +818,6 @@ void OmxVideoDecodeAccelerator::OnOutputPortEnabled() {
void OmxVideoDecodeAccelerator::FillBufferDoneTask(
OMX_BUFFERHEADERTYPE* buffer) {
- // If we are destroying and then get a fillbuffer callback, calling into any
- // openmax function will put us in error mode, so bail now. In the RESETTING
- // case we still need to enqueue the picture ids but have to avoid giving
- // them to the client (this is handled below).
- if (current_state_change_ == DESTROYING ||
- current_state_change_ == ERRORING)
- return;
-
media::Picture* picture =
reinterpret_cast<media::Picture*>(buffer->pAppPrivate);
int picture_buffer_id = picture ? picture->picture_buffer_id() : -1;
@@ -836,6 +828,14 @@ void OmxVideoDecodeAccelerator::FillBufferDoneTask(
DCHECK_GT(output_buffers_at_component_, 0);
--output_buffers_at_component_;
+ // If we are destroying and then get a fillbuffer callback, calling into any
+ // openmax function will put us in error mode, so bail now. In the RESETTING
+ // case we still need to enqueue the picture ids but have to avoid giving
+ // them to the client (this is handled below).
+ if (current_state_change_ == DESTROYING ||
+ current_state_change_ == ERRORING)
+ return;
+
if (fake_output_buffers_.size() && fake_output_buffers_.count(buffer)) {
size_t erased = fake_output_buffers_.erase(buffer);
DCHECK_EQ(erased, 1U);
« 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