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

Unified Diff: webrtc/modules/audio_device/android/audio_device_template.h

Issue 1296693003: Fix initialization/termination of AudioDeviceTemplate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/android/audio_device_template.h
diff --git a/webrtc/modules/audio_device/android/audio_device_template.h b/webrtc/modules/audio_device/android/audio_device_template.h
index adc66fa6d44d4caaa3d4ce907d26ca183f49e17d..9416c25c43f03705d1f329430c8311d1885f92df 100644
--- a/webrtc/modules/audio_device/android/audio_device_template.h
+++ b/webrtc/modules/audio_device/android/audio_device_template.h
@@ -60,14 +60,15 @@ class AudioDeviceTemplate : public AudioDeviceGeneric {
int32_t Init() override {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!initialized_);
- initialized_ = audio_manager_->Init() || output_.Init() || input_.Init();
+ initialized_ =
+ audio_manager_->Init() & ((output_.Init() | input_.Init()) == 0);
tommi (sloooow) - chröme 2015/08/17 08:23:19 Great that you noticed this. Why bitwise operator
Satoshi Matsumoto 2015/08/17 16:40:23 Done.
return initialized_ ? 0 : -1;
}
int32_t Terminate() override {
DCHECK(thread_checker_.CalledOnValidThread());
- initialized_ =
- !(output_.Terminate() || input_.Terminate() || audio_manager_->Close());
+ initialized_ = ((output_.Terminate() | input_.Terminate()) != 0) |
+ !audio_manager_->Close();
tommi (sloooow) - chröme 2015/08/17 08:23:19 There's not really much we can do here if things g
Satoshi Matsumoto 2015/08/17 16:40:23 Done.
return !initialized_ ? 0 : -1;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698