hardware/alsa_sound
Révision | 68a5d4f36e98119d656fa8a76e4944e44ba72678 (tree) |
---|---|
l'heure | 2010-09-06 21:09:24 |
Auteur | Sean McNeil <sean.mcneil@wind...> |
Commiter | Sean McNeil |
Clean up locks and route.
Remove lock from AudioHardwareALSA class.
Do not call route for handles that have never been opened when mode
changes.
Change-Id: Ifce6718d5f1df235b78b10c86cf2f61b3ae12a69
@@ -153,11 +153,12 @@ status_t AudioHardwareALSA::setMode(int mode) | ||
153 | 153 | if (status == NO_ERROR) { |
154 | 154 | // take care of mode change. |
155 | 155 | for(ALSAHandleList::iterator it = mDeviceList.begin(); |
156 | - it != mDeviceList.end(); ++it) { | |
157 | - status = mALSADevice->route(&(*it), it->curDev, mode); | |
158 | - if (status != NO_ERROR) | |
159 | - break; | |
160 | - } | |
156 | + it != mDeviceList.end(); ++it) | |
157 | + if (it->curDev) { | |
158 | + status = mALSADevice->route(&(*it), it->curDev, mode); | |
159 | + if (status != NO_ERROR) | |
160 | + break; | |
161 | + } | |
161 | 162 | } |
162 | 163 | } |
163 | 164 |
@@ -171,8 +172,6 @@ AudioHardwareALSA::openOutputStream(uint32_t devices, | ||
171 | 172 | uint32_t *sampleRate, |
172 | 173 | status_t *status) |
173 | 174 | { |
174 | - AutoMutex lock(mLock); | |
175 | - | |
176 | 175 | LOGD("openOutputStream called for devices: 0x%08x", devices); |
177 | 176 | |
178 | 177 | status_t err = BAD_VALUE; |
@@ -202,7 +201,6 @@ AudioHardwareALSA::openOutputStream(uint32_t devices, | ||
202 | 201 | void |
203 | 202 | AudioHardwareALSA::closeOutputStream(AudioStreamOut* out) |
204 | 203 | { |
205 | - AutoMutex lock(mLock); | |
206 | 204 | delete out; |
207 | 205 | } |
208 | 206 |
@@ -214,8 +212,6 @@ AudioHardwareALSA::openInputStream(uint32_t devices, | ||
214 | 212 | status_t *status, |
215 | 213 | AudioSystem::audio_in_acoustics acoustics) |
216 | 214 | { |
217 | - AutoMutex lock(mLock); | |
218 | - | |
219 | 215 | status_t err = BAD_VALUE; |
220 | 216 | AudioStreamInALSA *in = 0; |
221 | 217 |
@@ -242,7 +238,6 @@ AudioHardwareALSA::openInputStream(uint32_t devices, | ||
242 | 238 | void |
243 | 239 | AudioHardwareALSA::closeInputStream(AudioStreamIn* in) |
244 | 240 | { |
245 | - AutoMutex lock(mLock); | |
246 | 241 | delete in; |
247 | 242 | } |
248 | 243 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* AudioHardwareALSA.h |
2 | 2 | ** |
3 | - ** Copyright 2008-2009, Wind River Systems | |
3 | + ** Copyright 2008-2010, Wind River Systems | |
4 | 4 | ** |
5 | 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
6 | 6 | ** you may not use this file except in compliance with the License. |
@@ -356,9 +356,6 @@ protected: | ||
356 | 356 | acoustic_device_t * mAcousticDevice; |
357 | 357 | |
358 | 358 | ALSAHandleList mDeviceList; |
359 | - | |
360 | -private: | |
361 | - Mutex mLock; | |
362 | 359 | }; |
363 | 360 | |
364 | 361 | // ---------------------------------------------------------------------------- |