diff options
author | Andy Hung <hunga@google.com> | 2015-06-18 22:05:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-18 22:05:41 +0000 |
commit | c675cf0fff3da75a92bc157e3bf698cc5a1f6eb3 (patch) | |
tree | 2beb92ab6df1c7d434137fd9c6d547a1e0d4567b /media/libmedia | |
parent | 652c2207fe19bef3657a5abe865f9f9b2a4cd866 (diff) | |
parent | 1f1db8356b599bc40703c907fb69e6e539343532 (diff) | |
download | frameworks_av-c675cf0fff3da75a92bc157e3bf698cc5a1f6eb3.zip frameworks_av-c675cf0fff3da75a92bc157e3bf698cc5a1f6eb3.tar.gz frameworks_av-c675cf0fff3da75a92bc157e3bf698cc5a1f6eb3.tar.bz2 |
Merge "Fix AudioTrack comments relating to use of restoreTrack_l()" into mnc-dev
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 81ae6d7..949bc21 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -986,15 +986,18 @@ status_t AudioTrack::getPosition(uint32_t *position) } if (mOutput != AUDIO_IO_HANDLE_NONE) { - uint32_t halFrames; - AudioSystem::getRenderPosition(mOutput, &halFrames, &dspFrames); + uint32_t halFrames; // actually unused + (void) AudioSystem::getRenderPosition(mOutput, &halFrames, &dspFrames); + // FIXME: on getRenderPosition() error, we return OK with frame position 0. } // FIXME: dspFrames may not be zero in (mState == STATE_STOPPED || mState == STATE_FLUSHED) // due to hardware latency. We leave this behavior for now. *position = dspFrames; } else { if (mCblk->mFlags & CBLK_INVALID) { - restoreTrack_l("getPosition"); + (void) restoreTrack_l("getPosition"); + // FIXME: for compatibility with the Java API we ignore the restoreTrack_l() + // error here (e.g. DEAD_OBJECT) and return OK with the last recorded server position. } // IAudioTrack::stop() isn't synchronous; we don't know when presentation completes @@ -2080,7 +2083,8 @@ status_t AudioTrack::restoreTrack_l(const char *from) AudioSystem::clearAudioConfigCache(); if (isOffloadedOrDirect_l() || mDoNotReconnect) { - // FIXME re-creation of offloaded tracks is not yet implemented + // FIXME re-creation of offloaded and direct tracks is not yet implemented; + // reconsider enabling for linear PCM encodings when position can be preserved. return DEAD_OBJECT; } |