From 53c3b5fc1afe162a8669cb3d27d6bb14e1847e39 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Mon, 15 Dec 2014 16:42:05 -0800 Subject: Improve AudioTrack EVENT_LOOP_END and EVENT_BUFFER_END accuracy Fix timing computation to consider current position. Fix EVENT_LOOP_END count accuracy (some could be dropped before) for non-infinite loop static AudioTracks. Change-Id: I255f692915b55ab6f08ccd6a2365fee3f5d0a4fe --- include/media/AudioTrack.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 0f9df4f..c995bd2 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -736,6 +736,10 @@ protected: int32_t mLoopCount; // last setLoop loopCount; zero means disabled uint32_t mLoopStart; // last setLoop loopStart uint32_t mLoopEnd; // last setLoop loopEnd + int32_t mLoopCountNotified; // the last loopCount notified by callback. + // mLoopCountNotified counts down, matching + // the remaining loop count for static track + // playback. // These are private to processAudioBuffer(), and are not protected by a lock uint32_t mRemainingFrames; // number of frames to request in obtainBuffer() -- cgit v1.1