Commit 28c6eb58 authored by qinmin@chromium.org's avatar qinmin@chromium.org

Fix the flaky MediaSourcePlayerTest

If seek happens while requesting data for the inactive chunk, the ack for the data request will call OnDecodeCompleted().
However, the decoder job is waiting for the OnDecodeCompleted() from the active chunk.
Tests:We already have seveal tests covering requesting inactive chunk during seek. This CL should fix the flakiness in there.

BUG=361541

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262934 0039d316-1c4b-4281-b951-d872f2087c98
parent 44f6474d
...@@ -72,13 +72,19 @@ void MediaDecoderJob::OnDataReceived(const DemuxerData& data) { ...@@ -72,13 +72,19 @@ void MediaDecoderJob::OnDataReceived(const DemuxerData& data) {
is_requesting_demuxer_data_ = false; is_requesting_demuxer_data_ = false;
base::Closure done_cb = base::ResetAndReturn(&on_data_received_cb_); 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_) { if (stop_decode_pending_) {
DCHECK(is_decoding());
OnDecodeCompleted(MEDIA_CODEC_STOPPED, kNoTimestamp(), 0); OnDecodeCompleted(MEDIA_CODEC_STOPPED, kNoTimestamp(), 0);
return; return;
} }
if (!done_cb.is_null()) done_cb.Run();
done_cb.Run();
} }
void MediaDecoderJob::Prefetch(const base::Closure& prefetch_cb) { void MediaDecoderJob::Prefetch(const base::Closure& prefetch_cb) {
......
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