diff options
author | Andy Hung <hunga@google.com> | 2015-07-24 21:02:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-07-24 21:02:52 +0000 |
commit | 2c7d0f2013203588f9307166cad42902eb5a676f (patch) | |
tree | 9460ada2b046711356148a6c84468afbb51bb858 /media/libmedia/AudioTrack.cpp | |
parent | 5ce059661dcbab8924edab400681fc408ee76123 (diff) | |
parent | d7bd69e4d1e74f25413721804d5290c53ea87f2b (diff) | |
download | frameworks_av-2c7d0f2013203588f9307166cad42902eb5a676f.zip frameworks_av-2c7d0f2013203588f9307166cad42902eb5a676f.tar.gz frameworks_av-2c7d0f2013203588f9307166cad42902eb5a676f.tar.bz2 |
Merge "Fix restore position warning and static track adjustment" into mnc-dev
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 9b40d45..7befe5d 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -483,7 +483,6 @@ status_t AudioTrack::set( mMarkerReached = false; mNewPosition = 0; mUpdatePeriod = 0; - mServer = 0; mPosition = 0; mReleased = 0; mStartUs = 0; @@ -1389,6 +1388,9 @@ status_t AudioTrack::createTrack_l() mReqFrameCount = frameCount; } + // reset server position to 0 as we have new cblk. + mServer = 0; + // update proxy if (mSharedBuffer == 0) { mStaticProxy.clear(); @@ -2109,15 +2111,13 @@ status_t AudioTrack::restoreTrack_l(const char *from) // If a new IAudioTrack cannot be created, the previous (dead) instance will be left intact. status_t result = createTrack_l(); - // take the frames that will be lost by track recreation into account in saved position - // For streaming tracks, this is the amount we obtained from the user/client - // (not the number actually consumed at the server - those are already lost). - (void) updateAndGetPosition_l(); - if (mStaticProxy == 0) { - mPosition = mReleased; - } - if (result == NO_ERROR) { + // take the frames that will be lost by track recreation into account in saved position + // For streaming tracks, this is the amount we obtained from the user/client + // (not the number actually consumed at the server - those are already lost). + if (mStaticProxy == 0) { + mPosition = mReleased; + } // Continue playback from last known position and restore loop. if (mStaticProxy != 0) { if (loopCount != 0) { |