Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-alsa_sound: Commit

hardware/alsa_sound


Commit MetaInfo

Révision68a5d4f36e98119d656fa8a76e4944e44ba72678 (tree)
l'heure2010-09-06 21:09:24
AuteurSean McNeil <sean.mcneil@wind...>
CommiterSean McNeil

Message de Log

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

Change Summary

Modification

--- a/AudioHardwareALSA.cpp
+++ b/AudioHardwareALSA.cpp
@@ -153,11 +153,12 @@ status_t AudioHardwareALSA::setMode(int mode)
153153 if (status == NO_ERROR) {
154154 // take care of mode change.
155155 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+ }
161162 }
162163 }
163164
@@ -171,8 +172,6 @@ AudioHardwareALSA::openOutputStream(uint32_t devices,
171172 uint32_t *sampleRate,
172173 status_t *status)
173174 {
174- AutoMutex lock(mLock);
175-
176175 LOGD("openOutputStream called for devices: 0x%08x", devices);
177176
178177 status_t err = BAD_VALUE;
@@ -202,7 +201,6 @@ AudioHardwareALSA::openOutputStream(uint32_t devices,
202201 void
203202 AudioHardwareALSA::closeOutputStream(AudioStreamOut* out)
204203 {
205- AutoMutex lock(mLock);
206204 delete out;
207205 }
208206
@@ -214,8 +212,6 @@ AudioHardwareALSA::openInputStream(uint32_t devices,
214212 status_t *status,
215213 AudioSystem::audio_in_acoustics acoustics)
216214 {
217- AutoMutex lock(mLock);
218-
219215 status_t err = BAD_VALUE;
220216 AudioStreamInALSA *in = 0;
221217
@@ -242,7 +238,6 @@ AudioHardwareALSA::openInputStream(uint32_t devices,
242238 void
243239 AudioHardwareALSA::closeInputStream(AudioStreamIn* in)
244240 {
245- AutoMutex lock(mLock);
246241 delete in;
247242 }
248243
--- a/AudioHardwareALSA.h
+++ b/AudioHardwareALSA.h
@@ -1,6 +1,6 @@
11 /* AudioHardwareALSA.h
22 **
3- ** Copyright 2008-2009, Wind River Systems
3+ ** Copyright 2008-2010, Wind River Systems
44 **
55 ** Licensed under the Apache License, Version 2.0 (the "License");
66 ** you may not use this file except in compliance with the License.
@@ -356,9 +356,6 @@ protected:
356356 acoustic_device_t * mAcousticDevice;
357357
358358 ALSAHandleList mDeviceList;
359-
360-private:
361- Mutex mLock;
362359 };
363360
364361 // ----------------------------------------------------------------------------
Afficher sur ancien navigateur de dépôt.