Commit 76042fb7 authored by qinmin@chromium.org's avatar qinmin@chromium.org

Cancel the starvation callback when MediaSourcePlayer::Release() gets called.

If we don't cancel the starvation callback, ProcessPendingEvents will get executed later when the callback fires.
Because we use a BarrierClosure in ProcessPendingEvents() and the count is 0 as both audio and video decoders are released, OnPrefetchDone() will be immediately called.
And this will cause ProcessPendingEvents() to get called again and again, thus crashing chrome.

An alternative to this fix is to check count before creating the barrier.
Logically starvation callback should not get called after Release().

BUG=285573

Review URL: https://chromiumcodereview.appspot.com/23672025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221509 0039d316-1c4b-4281-b951-d872f2087c98
parent 5764dcce
......@@ -178,6 +178,7 @@ void MediaSourcePlayer::Release() {
reconfig_video_decoder_ = false;
playing_ = false;
pending_event_ = NO_EVENT_PENDING;
decoder_starvation_callback_.Cancel();
surface_ = gfx::ScopedJavaSurface();
ReleaseMediaResourcesFromManager();
}
......
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