OSDN Git Service

Document AudioTrack mFrameCount and mReqFrameCount better
authorGlenn Kasten <gkasten@google.com>
Wed, 8 Jan 2014 16:54:23 +0000 (08:54 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 10 Jan 2014 18:53:22 +0000 (10:53 -0800)
and remove unnecessary initialization of mFrameCount in set().

Change-Id: I9effeb0a6dd035ca02fe77f6992c55d9515b4df6

include/media/AudioTrack.h
media/libmedia/AudioTrack.cpp

index 8afcc5d..476896f 100644 (file)
@@ -664,9 +664,10 @@ protected:
     float                   mVolume[2];
     float                   mSendLevel;
     mutable uint32_t        mSampleRate;            // mutable because getSampleRate() can update it.
-    size_t                  mFrameCount;            // corresponds to current IAudioTrack
-    size_t                  mReqFrameCount;         // frame count to request the next time a new
-                                                    // IAudioTrack is needed
+    size_t                  mFrameCount;            // corresponds to current IAudioTrack, value is
+                                                    // reported back by AudioFlinger to the client
+    size_t                  mReqFrameCount;         // frame count to request the first or next time
+                                                    // a new IAudioTrack is needed, non-decreasing
 
     // constant after constructor or set()
     audio_format_t          mFormat;                // as requested by client, not forced to 16-bit
index a6ffc62..7f6fd7a 100644 (file)
@@ -318,7 +318,7 @@ status_t AudioTrack::set(
     mVolume[LEFT] = 1.0f;
     mVolume[RIGHT] = 1.0f;
     mSendLevel = 0.0f;
-    mFrameCount = frameCount;
+    // mFrameCount is initialized in createTrack_l
     mReqFrameCount = frameCount;
     mNotificationFramesReq = notificationFrames;
     mNotificationFramesAct = 0;