Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-alsa_sound: 提交

hardware/alsa_sound


Commit MetaInfo

修订版886aa88eb68e691b05a1335564adcf4ac8a925a3 (tree)
时间2010-09-02 12:08:53
作者Sean McNeil <sean.mcneil@wind...>
CommiterSean McNeil

Log Message

Hold lock when doing a route.

Routing can end up closing and re-opening an audio path (alsa_default.cpp).
If this happend while audio is being played or recorded, then the handle
can become invalid and cause a crash in the ALSA library.

Change-Id: I2ab62cec0b8a77abdfb890c2addf7e3f54aca750

更改概述

差异

--- a/ALSAStreamOps.cpp
+++ b/ALSAStreamOps.cpp
@@ -161,6 +161,7 @@ status_t ALSAStreamOps::setParameters(const String8& keyValuePairs)
161161 LOGV("setParameters() %s", keyValuePairs.string());
162162
163163 if (param.getInt(key, device) == NO_ERROR) {
164+ AutoMutex lock(mLock);
164165 mParent->mALSADevice->route(mHandle, (uint32_t)device, mParent->mode());
165166 param.remove(key);
166167 }
Show on old repository browser