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

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

Issue 10943003: Fix deadlock in VAAPI video decoder error cases. (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
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/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();
« 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