Add comments
Change-Id: Ifbf3a46a4183c8abc0feee1c588953ab10303cc1
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 33c4462..3f4cbc2 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -585,6 +585,7 @@
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::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 @@
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;