Commit 6a1f7b51 authored by gunsch's avatar gunsch Committed by Commit bot

Removes MediaDecoderJob virtual method call from destructor.

This execution path is currently seen used when destroying a
VideoDecoderJob that's still decoding:
* MediaDecoderJob::Release (early return, destroy_pending_=true)
* ...
* MediaDecoderJob::OnDecodeComplete
* ~VideoDecoderJob
* ~MediaDecoderJob
* MediaDecoderJob::ReleaseMediaCodecBridge
* MediaDecoderJob::OnMediaCodecBridgeReleased <-- !!!

The last line should be:
* VideoDecoderJob::OnMediaCodecBridgeReleased

but since it is invoked during the destructor the overridden
implementation is not executed.

R=qinmin@chromium.org,xhwang@chromium.org
BUG=internal b/17671489

Review URL: https://codereview.chromium.org/647553003

Cr-Commit-Position: refs/heads/master@{#299159}
parent a27b85e6
...@@ -48,7 +48,7 @@ MediaDecoderJob::MediaDecoderJob( ...@@ -48,7 +48,7 @@ MediaDecoderJob::MediaDecoderJob(
} }
MediaDecoderJob::~MediaDecoderJob() { MediaDecoderJob::~MediaDecoderJob() {
ReleaseMediaCodecBridge(); DCHECK(!media_codec_bridge_);
} }
void MediaDecoderJob::OnDataReceived(const DemuxerData& data) { void MediaDecoderJob::OnDataReceived(const DemuxerData& data) {
...@@ -232,6 +232,7 @@ void MediaDecoderJob::Release() { ...@@ -232,6 +232,7 @@ void MediaDecoderJob::Release() {
return; return;
} }
ReleaseMediaCodecBridge();
delete this; delete this;
} }
...@@ -500,6 +501,7 @@ void MediaDecoderJob::OnDecodeCompleted( ...@@ -500,6 +501,7 @@ void MediaDecoderJob::OnDecodeCompleted(
if (destroy_pending_) { if (destroy_pending_) {
DVLOG(1) << __FUNCTION__ << " : completing pending deletion"; DVLOG(1) << __FUNCTION__ << " : completing pending deletion";
ReleaseMediaCodecBridge();
delete this; delete this;
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment