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

Unified Diff: media/base/android/media_decoder_job.cc

Issue 51613002: Abort MSP::OnPrefetchDone() if just after MSP::Release(). Let seek and config change survive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add more unit test coverage Created 7 years, 2 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
Index: media/base/android/media_decoder_job.cc
diff --git a/media/base/android/media_decoder_job.cc b/media/base/android/media_decoder_job.cc
index cd8d04cfe3fdba4d6ccdf93ffa33dcff732b3e06..4558845f325f043a796408b0a341a2271a05199e 100644
--- a/media/base/android/media_decoder_job.cc
+++ b/media/base/android/media_decoder_job.cc
@@ -67,10 +67,12 @@ void MediaDecoderJob::Prefetch(const base::Closure& prefetch_cb) {
DCHECK(decode_cb_.is_null());
if (HasData()) {
+ DVLOG(1) << __FUNCTION__ << " : using previously received data";
ui_loop_->PostTask(FROM_HERE, prefetch_cb);
return;
}
+ DVLOG(1) << __FUNCTION__ << " : requesting data";
RequestData(prefetch_cb);
}
@@ -134,6 +136,7 @@ void MediaDecoderJob::BeginPrerolling(
void MediaDecoderJob::Release() {
DCHECK(ui_loop_->BelongsToCurrentThread());
+ DVLOG(1) << __FUNCTION__;
// If the decoder job is not waiting for data, and is still decoding, we
// cannot delete the job immediately.
@@ -143,8 +146,10 @@ void MediaDecoderJob::Release() {
on_data_received_cb_.Reset();
decode_cb_.Reset();
- if (destroy_pending_)
+ if (destroy_pending_) {
+ DVLOG(1) << __FUNCTION__ << " : delete is pending decode completion";
return;
+ }
delete this;
}
@@ -372,6 +377,7 @@ void MediaDecoderJob::OnDecodeCompleted(
DCHECK(ui_loop_->BelongsToCurrentThread());
if (destroy_pending_) {
+ DVLOG(1) << __FUNCTION__ << " : completing pending deletion";
delete this;
return;
}

Powered by Google App Engine
This is Rietveld 408576698