OSDN Git Service

audio policy: reuse direct output when possible
authorEric Laurent <elaurent@google.com>
Thu, 4 Apr 2013 00:31:04 +0000 (17:31 -0700)
committerEric Laurent <elaurent@google.com>
Thu, 4 Apr 2013 21:18:40 +0000 (14:18 -0700)
commit5a950c960cd40648cc3ab8defe817f88e0a7ecf4
treeff6d4cc9ebfa63688b764ab314b552bb3762b88b
parent80f5b0400f86d49e70aa1a793b34f34492f005bc
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
audio/AudioPolicyManagerBase.cpp
include/hardware_legacy/AudioPolicyManagerBase.h