From a4f24ff9b239300b4bb2098c1413c0a60edc2d7e Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 27 Nov 2013 14:29:13 -0800 Subject: AudioTrack: fix position callback after restore When restoring an AudioTrack, the next position callback point should not be modified and set ahead of current buffer head. Otherwise, as frames are dropped, the new position is never reached and an application relying on position callbacks to reload the buffer would be stalled. Bug: 11868603. Change-Id: I93b2a311642a0c89944b78bcc0482d4ceed98ae4 --- media/libmedia/AudioTrack.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'media/libmedia') diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index b8a89a0..7c4a990 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -1675,7 +1675,6 @@ status_t AudioTrack::restoreTrack_l(const char *from) // take the frames that will be lost by track recreation into account in saved position size_t position = mProxy->getPosition() + mProxy->getFramesFilled(); - mNewPosition = position + mUpdatePeriod; size_t bufferPosition = mStaticProxy != NULL ? mStaticProxy->getBufferPosition() : 0; result = createTrack_l(mStreamType, mSampleRate, -- cgit v1.1