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 de862197752cc2d491d7c388b15a5266ccc374a3..2e1c5fc80aeb6dbf23a1a8d5d025e9dda57911b1 100644 |
--- a/content/common/gpu/media/omx_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/omx_video_decode_accelerator.cc |
@@ -359,6 +359,14 @@ void OmxVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { |
TRACE_EVENT1("Video Decoder", "OVDA::ReusePictureBuffer", |
"Picture id", picture_buffer_id); |
DCHECK_EQ(message_loop_, MessageLoop::current()); |
+ |
+ // If we are resetting, don't bother, as OMX_FillThisBuffer will fail anyway. |
+ // If we're in the middle of closing, this will put the Accelerator in |
+ // ERRORING mode, which has the side effect of not going through the |
+ // OMX_FreeBuffers path and leaks memory. |
+ if (current_state_change_ == RESETTING) |
Ami GONE FROM CHROMIUM
2012/08/11 04:29:00
|| DESTROYING || ERRORING
marcheu
2012/08/13 19:23:04
Done.
|
+ return; |
+ |
RETURN_ON_FAILURE(CanFillBuffer(), "Can't fill buffer", ILLEGAL_STATE,); |
OutputPictureById::iterator it = pictures_.find(picture_buffer_id); |