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

Unified Diff: media/audio/win/audio_low_latency_output_win.cc

Issue 2801073005: [reland] Do not block in SimpleThread::Start(). (Closed)
Patch Set: Created 3 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 | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/audio_low_latency_output_win.cc
diff --git a/media/audio/win/audio_low_latency_output_win.cc b/media/audio/win/audio_low_latency_output_win.cc
index 3dbb7d6b0b559e8c9fc61ea602857818c6b0929c..8ad7f79d9d26ee427870f5b7c2780b829ca01fda 100644
--- a/media/audio/win/audio_low_latency_output_win.cc
+++ b/media/audio/win/audio_low_latency_output_win.cc
@@ -281,12 +281,6 @@ void WASAPIAudioOutputStream::Start(AudioSourceCallback* callback) {
this, "wasapi_render_thread",
base::SimpleThread::Options(base::ThreadPriority::REALTIME_AUDIO)));
render_thread_->Start();
- if (!render_thread_->HasBeenStarted()) {
- LOG(ERROR) << "Failed to start WASAPI render thread.";
- StopThread();
- callback->OnError(this);
- return;
- }
// Start streaming data between the endpoint buffer and the audio engine.
HRESULT hr = audio_client_->Start();
@@ -639,11 +633,9 @@ HRESULT WASAPIAudioOutputStream::ExclusiveModeInitialization(
void WASAPIAudioOutputStream::StopThread() {
if (render_thread_) {
- if (render_thread_->HasBeenStarted()) {
- // Wait until the thread completes and perform cleanup.
- SetEvent(stop_render_event_.Get());
- render_thread_->Join();
- }
+ // Wait until the thread completes and perform cleanup.
+ SetEvent(stop_render_event_.Get());
+ render_thread_->Join();
render_thread_.reset();
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698