diff options
author | Ramjee Singh <ramjee@codeaurora.org> | 2019-04-29 16:10:27 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-06-12 21:01:15 -0700 |
commit | 2c9add7250b8fa0590f6106fc837510549f76367 (patch) | |
tree | 205c9176c97feaa0022ebd1beb1496e769424928 | |
parent | 177e6ea9a3b65ed28ac70040130fceb3911782ea (diff) | |
download | android_vendor_qcom_opensource_audio-2c9add7250b8fa0590f6106fc837510549f76367.tar.gz android_vendor_qcom_opensource_audio-2c9add7250b8fa0590f6106fc837510549f76367.tar.bz2 android_vendor_qcom_opensource_audio-2c9add7250b8fa0590f6106fc837510549f76367.zip |
audiopolicy: Check open outputs count before closing.
- In compress offload session subsystem restart triggers
invalidaton. For direct or compress session NuPlayer
is notified as track cant be restored and it restarts
session with direct attributes which fails again as sound
card is offline and output descriptor is closed on this
failed attempt. While closing the output descriptor its
open count is checked and if its less than 1 its logged
as fatal.
- Fix is to avoid closing of output descriptor if its
not opened successfully.
Change-Id: I0456edcbdea483a5620a33aca5d4da2b93b04589
-rw-r--r-- | policy_hal/AudioPolicyManager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index cb7db23..830ebe1 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -1795,7 +1795,8 @@ audio_io_handle_t AudioPolicyManagerCustom::getOutputForDevices( "format %d %d, channel mask %04x %04x", output, config->sample_rate, outputDesc->mSamplingRate, config->format, outputDesc->mFormat, channelMask, outputDesc->mChannelMask); - if (output != AUDIO_IO_HANDLE_NONE) { + //Only close o/p descriptor if successfully opened + if (status == NO_ERROR) { outputDesc->close(); } // fall back to mixer output if possible when the direct output could not be open |