media: Fix a GpuVideoDecoder initialization crash on Android
Previously OnSurfaceAvailable() would call CompleteInitialization() if init_cb_ was not null, but init_cb_ isn't reset until later in NotifyInitializationComplete(). So if OnSurfaceAvailable() was called more than once before deferred initialization completed, we would erroneously call CompleteInitialization() more than once. This CL cleans up the logic for OnSurfaceAvailable() so it's safe to call at any time, and ensures that CompleteInitialization() only runs once. BUG=677775 Review-Url: https://codereview.chromium.org/2621153004 Cr-Commit-Position: refs/heads/master@{#443124}
Showing
Please register or sign in to comment