am 72f83fe8: am 2c798912: alsa_sound: avoid pcm_open error
* commit '72f83fe83242142ad3f10fb87f19e6d7d33b7c49':
alsa_sound: avoid pcm_open error
diff --git a/alsa_sound/ALSAStreamOps.cpp b/alsa_sound/ALSAStreamOps.cpp
index aafc736..4e534fd 100644
--- a/alsa_sound/ALSAStreamOps.cpp
+++ b/alsa_sound/ALSAStreamOps.cpp
@@ -214,12 +214,16 @@
if (param.getInt(key, device) == NO_ERROR) {
// Ignore routing if device is 0.
- ALOGD("setParameters(): keyRouting with device %d", device);
+ ALOGD("setParameters(): keyRouting with device 0x%x", device);
// reset to speaker when disconnecting HDMI to avoid timeout due to write errors
if ((device == 0) && (mDevices == AudioSystem::DEVICE_OUT_AUX_DIGITAL)) {
device = AudioSystem::DEVICE_OUT_SPEAKER;
}
- mDevices = device;
+ if (device)
+ mDevices = device;
+ else
+ ALOGV("must not change mDevices to 0");
+
if(device) {
mParent->doRouting(device);
}
diff --git a/alsa_sound/AudioStreamOutALSA.cpp b/alsa_sound/AudioStreamOutALSA.cpp
index 64492ba..d047cd4 100644
--- a/alsa_sound/AudioStreamOutALSA.cpp
+++ b/alsa_sound/AudioStreamOutALSA.cpp
@@ -178,8 +178,6 @@
mHandle->module->route(mHandle, mDevices , mParent->mode());
#endif
} else {
- if (!mDevices)
- mDevices = mParent->mCurDevice;
mHandle->module->route(mHandle, mDevices , mParent->mode());
}
if (!strcmp(mHandle->useCase, SND_USE_CASE_VERB_HIFI) ||