diff options
author | Glenn Kasten <gkasten@google.com> | 2013-07-17 14:44:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-17 14:44:51 +0000 |
commit | cff1b2359b8a302f19539c0bc5d25c98a52733fd (patch) | |
tree | e0d7b7b64f4b3a9cf3eb7d2158de59efb4bd0b3a /media/libmedia/AudioTrack.cpp | |
parent | bb849b5d1a0364b69aa15ed00709edf4b7e348fc (diff) | |
parent | fb1fdc9d6603aa228362e7349451f6455c9849c2 (diff) | |
download | frameworks_av-cff1b2359b8a302f19539c0bc5d25c98a52733fd.zip frameworks_av-cff1b2359b8a302f19539c0bc5d25c98a52733fd.tar.gz frameworks_av-cff1b2359b8a302f19539c0bc5d25c98a52733fd.tar.bz2 |
Merge "Add comments"
Diffstat (limited to 'media/libmedia/AudioTrack.cpp')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 00f4640..7b6b38d 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -585,6 +585,7 @@ void AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount) status_t AudioTrack::setMarkerPosition(uint32_t marker) { + // The only purpose of setting marker position is to get a callback if (mCbf == NULL) { return INVALID_OPERATION; } @@ -610,6 +611,7 @@ status_t AudioTrack::getMarkerPosition(uint32_t *marker) const status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod) { + // The only purpose of setting position update period is to get a callback if (mCbf == NULL) { return INVALID_OPERATION; } @@ -1220,6 +1222,11 @@ status_t TimedAudioTrack::setMediaTimeTransform(const LinearTransform& xform, nsecs_t AudioTrack::processAudioBuffer(const sp<AudioTrackThread>& thread) { + // Currently the AudioTrack thread is not created if there are no callbacks. + // Would it ever make sense to run the thread, even without callbacks? + // If so, then replace this by checks at each use for mCbf != NULL. + LOG_ALWAYS_FATAL_IF(mCblk == NULL); + mLock.lock(); if (mAwaitBoost) { mAwaitBoost = false; |