summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioTrack.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-05-08 18:57:51 -0700
committerEric Laurent <elaurent@google.com>2012-05-14 17:20:12 -0700
commit2986460984580833161bdaabc7f17da1005a8961 (patch)
treebd8aa210c0faee61dc45e23479e29cfc85f313c2 /media/libmedia/AudioTrack.cpp
parentdfa29ab13647f22b30b2de34d4830c9e815bf120 (diff)
downloadframeworks_av-2986460984580833161bdaabc7f17da1005a8961.zip
frameworks_av-2986460984580833161bdaabc7f17da1005a8961.tar.gz
frameworks_av-2986460984580833161bdaabc7f17da1005a8961.tar.bz2
Fix issues with synchronous record start.
- Added a timeout in case the trigger event is never fired. - Extend AudioRecord obtainBuffer() timeout in case of synchronous start to avoid spurious warning. - Make sure that the event is triggered if the track is destroyed. - Reject event if the triggering track is in an incompatible state. Also fix a problem when restoring a static AudioTrack after a mediaserver crash. Bug 6449468. Change-Id: Ib36e11111fb88f73caa31dcb0622792737d57a4b
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r--media/libmedia/AudioTrack.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 6189be5..5e6cd51 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -1365,6 +1365,9 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart)
mCblk->stepUser(frames);
}
}
+ if (mSharedBuffer != 0) {
+ mCblk->stepUser(mCblk->frameCount);
+ }
if (mActive) {
result = mAudioTrack->start();
ALOGW_IF(result != NO_ERROR, "restoreTrack_l() start() failed status %d", result);