Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
index 45f7f2b8db9f098fc1fbdbca76a80cdc2f9ab864..301e124143ac4a65650fdacc318b44f23891f1a5 100644 |
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc |
@@ -22,7 +22,9 @@ |
do { \ |
if (!(result)) { \ |
DVLOG(1) << log; \ |
- NotifyError(error_code); \ |
+ message_loop_->PostTask(FROM_HERE, base::Bind( \ |
Ami GONE FROM CHROMIUM
2012/09/18 02:21:28
This will delay clearing client_ potentially for l
sheu
2012/09/19 08:21:35
That would possibly be racy as well. I imagine th
sheu
2012/09/19 08:58:57
Oh! I see what you're doing there.
Posting the c
|
+ &VaapiVideoDecodeAccelerator::NotifyError, \ |
+ weak_this_, error_code)); \ |
return ret; \ |
} \ |
} while (0) |
@@ -36,15 +38,9 @@ VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { |
} |
void VaapiVideoDecodeAccelerator::NotifyError(Error error) { |
- if (message_loop_ != MessageLoop::current()) { |
- DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); |
- message_loop_->PostTask(FROM_HERE, base::Bind( |
- &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); |
- return; |
- } |
- |
+ // Always call this from a posted task, as it calls Cleanup(), which acquires |
+ // the member lock_. |
DVLOG(1) << "Notifying of error " << error; |
- |
if (client_) { |
client_->NotifyError(error); |
client_ptr_factory_.InvalidateWeakPtrs(); |