Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp
The per-thread timestamp latch was not synchronized with the per-track
released frames. Now the value of each track's released frames is
latched along with the timestamp.
Bug: 17531839
Bug: 17669342
Change-Id: I9d50c8c6a5de55a3f4561ac40e20d497376c1257
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 7af5264..bb9aa18 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -819,8 +819,11 @@
struct {
AudioTimestamp mTimestamp;
uint32_t mUnpresentedFrames;
+ KeyedVector<Track *, uint32_t> mFramesReleased;
} mLatchD, mLatchQ;
- bool mLatchDValid; // true means mLatchD is valid, and clock it into latch at next opportunity
+ bool mLatchDValid; // true means mLatchD is valid
+ // (except for mFramesReleased which is filled in later),
+ // and clock it into latch at next opportunity
bool mLatchQValid; // true means mLatchQ is valid
};