[Chromecast] Impl CaptureServiceReceiver::Stop in a sync way
We got crashes when accessing AudioInputCallback around the time we Stop/Close CastAudioInputStream. The audio_io.h is ambigeous on if the impl of Stop should be sync or async, but mostly it should be sync as AudioOutputStream::Stop. CaptureServiceReceiver::Stop is posted to another thread, and complete async, which explain the crashes we met. Therefore, add an internal stop function and let the public Stop wait for the internal stop completes. Bug: internal: 143908196 Test: On device and unittests. Change-Id: I9f6cfbd6457873094ce8c11ec6399b73012526dd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898720Reviewed-by:Yuchen Liu <yucliu@chromium.org> Commit-Queue: Kehuang Li <kehuangli@chromium.org> Cr-Commit-Position: refs/heads/master@{#712786}
Showing
Please register or sign in to comment