summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-30 15:14:47 -0800
committerEric Laurent <elaurent@google.com>2014-12-09 15:47:19 -0800
commit275e8e9de2e11b4b344f5a201f1f0e51fda02d9c (patch)
treec22e1c0b8541aa04fd6c8d803e4fa6704a84e6e2 /media/libmedia/AudioTrack.cpp
parent82a69ea8b090d57bff5e02774688b546a711bbb8 (diff)
downloadframeworks_av-275e8e9de2e11b4b344f5a201f1f0e51fda02d9c.zip
frameworks_av-275e8e9de2e11b4b344f5a201f1f0e51fda02d9c.tar.gz
frameworks_av-275e8e9de2e11b4b344f5a201f1f0e51fda02d9c.tar.bz2
audio policy: add support for custom mixes
Add support for custom mixes in AudioPolicyManager. Two methods are added to register or unregister a list of custom mixes with their attributes and format. getOutputForAttr() and getInputForAttr() first look for a match in registered mixes before defaulting to normal output/input selection Remote submix device connection disconnection now takes address into account to identify the correspnoding custom mix. Bug: 16009464. Change-Id: I3f1c2a485a0fb71b1f984ed0adc9b68aa971e408
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r--media/libmedia/AudioTrack.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index e4c3c08..d9c3177 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -851,6 +851,10 @@ status_t AudioTrack::getPosition(uint32_t *position)
// due to hardware latency. We leave this behavior for now.
*position = dspFrames;
} else {
+ if (mCblk->mFlags & CBLK_INVALID) {
+ restoreTrack_l("getPosition");
+ }
+
// IAudioTrack::stop() isn't synchronous; we don't know when presentation completes
*position = (mState == STATE_STOPPED || mState == STATE_FLUSHED) ?
0 : updateAndGetPosition_l();
@@ -1946,6 +1950,10 @@ status_t AudioTrack::getTimestamp(AudioTimestamp& timestamp)
break;
}
+ if (mCblk->mFlags & CBLK_INVALID) {
+ restoreTrack_l("getTimestamp");
+ }
+
// The presented frame count must always lag behind the consumed frame count.
// To avoid a race, read the presented frames first. This ensures that presented <= consumed.
status_t status = mAudioTrack->getTimestamp(timestamp);