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

Unified Diff: media/gpu/vt_video_decode_accelerator_mac.cc

Issue 2525143002: media: Destroy VTVDA session on the decoder thread. (Closed)
Patch Set: Be as cautious as possible. Created 4 years 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/vt_video_decode_accelerator_mac.cc
diff --git a/media/gpu/vt_video_decode_accelerator_mac.cc b/media/gpu/vt_video_decode_accelerator_mac.cc
index e179548de9bcfbc483f1f696cd9b3e02a5b99bef..f79b2da9118d6d4bce9ff7e891ee36e11c402c2a 100644
--- a/media/gpu/vt_video_decode_accelerator_mac.cc
+++ b/media/gpu/vt_video_decode_accelerator_mac.cc
@@ -815,8 +815,13 @@ void VTVideoDecodeAccelerator::FlushTask(TaskType type) {
FinishDelayedFrames();
- // Always queue a task, even if FinishDelayedFrames() fails, so that
- // destruction always completes.
+ if (type == TASK_DESTROY && session_) {
+ // Destroy the decoding session before returning from the decoder thread.
+ VTDecompressionSessionInvalidate(session_);
+ session_.reset();
+ }
+
+ // Queue a task even if flushing fails, so that destruction always completes.
gpu_task_runner_->PostTask(
FROM_HERE,
base::Bind(&VTVideoDecodeAccelerator::FlushDone, weak_this_, type));
« 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