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

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

Issue 227523005: Fix the flaky MediaSourcePlayerTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the comments Created 6 years, 8 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: 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 b7eef0cdfbfbdb0769aaab6b621fda43f2948108..8b8c9b2e31e1158bcfe1056e33e9142e69eb172b 100644
--- a/media/base/android/media_decoder_job.cc
+++ b/media/base/android/media_decoder_job.cc
@@ -72,13 +72,19 @@ void MediaDecoderJob::OnDataReceived(const DemuxerData& data) {
is_requesting_demuxer_data_ = false;
base::Closure done_cb = base::ResetAndReturn(&on_data_received_cb_);
+
+ // If this data request is for the inactive chunk, or |on_data_received_cb_|
+ // was set to null by ClearData() or Release(), do nothing.
+ if (done_cb.is_null())
+ return;
+
if (stop_decode_pending_) {
+ DCHECK(is_decoding());
OnDecodeCompleted(MEDIA_CODEC_STOPPED, kNoTimestamp(), 0);
return;
}
- if (!done_cb.is_null())
- done_cb.Run();
+ done_cb.Run();
}
void MediaDecoderJob::Prefetch(const base::Closure& prefetch_cb) {
« 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