diff options
author | Eric Laurent <elaurent@google.com> | 2013-04-03 17:31:04 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-04-04 14:18:40 -0700 |
commit | 5a950c960cd40648cc3ab8defe817f88e0a7ecf4 (patch) | |
tree | ff6d4cc9ebfa63688b764ab314b552bb3762b88b /include | |
parent | 80f5b0400f86d49e70aa1a793b34f34492f005bc (diff) | |
download | hardware_libhardware_legacy-5a950c960cd40648cc3ab8defe817f88e0a7ecf4.zip hardware_libhardware_legacy-5a950c960cd40648cc3ab8defe817f88e0a7ecf4.tar.gz hardware_libhardware_legacy-5a950c960cd40648cc3ab8defe817f88e0a7ecf4.tar.bz2 |
audio policy: reuse direct output when possible
Modified getOutput() logic to not systematically
open a new direct output when a profile matches a request.
This causes a problem when transitioning between two
multichannel tracks as the audio HAL will most of the times
only support one direct output stream open at a time.
Instead, reuse an open output if all the parameters match
or force close the output before reopening it.
Also modify releaseOuput():
- close a direct output only if no client is using it anymore
- call closeOutput() instead of removing the output from
the open output list: this factors in code executed when closing an
output stream.
Bug 8388941
Change-Id: Ic3d3beb21063622ddf57a5b932f93d56f2986f54
Diffstat (limited to 'include')
-rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index c5a917c..7ba71e7 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -275,6 +275,7 @@ protected: const IOProfile *mProfile; // I/O profile this output derives from bool mStrategyMutedByDevice[NUM_STRATEGIES]; // strategies muted because of incompatible // device selection. See checkDeviceMuteStrategies() + uint32_t mDirectOpenCount; // number of clients using this output (direct outputs only) }; // descriptor for audio inputs. Used to maintain current configuration of each opened audio input |