summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-02-02 22:32:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-02 22:32:37 +0000
commit547c9e5212cabc14efcd495935970ae98914a207 (patch)
tree20ce76701b25a5a63cc782823dc41793b0874215 /media
parent33984429054646fc125a7426e6f02b88715c1c10 (diff)
parent7a121563d5c94ca0b88539afd8a7e86cc9118b60 (diff)
downloadframeworks_base-547c9e5212cabc14efcd495935970ae98914a207.zip
frameworks_base-547c9e5212cabc14efcd495935970ae98914a207.tar.gz
frameworks_base-547c9e5212cabc14efcd495935970ae98914a207.tar.bz2
Merge "Clarify that flush does not necessarily free up buffer space"
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioTrack.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 1af0372..caccb6e 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1237,8 +1237,14 @@ public class AudioTrack
/**
* Flushes the audio data currently queued for playback. Any data that has
- * not been played back will be discarded. No-op if not stopped or paused,
+ * been written but not yet presented will be discarded. No-op if not stopped or paused,
* or if the track's creation mode is not {@link #MODE_STREAM}.
+ * <BR> Note that although data written but not yet presented is discarded, there is no
+ * guarantee that all of the buffer space formerly used by that data
+ * is available for a subsequent write.
+ * For example, a call to {@link #write(byte[], int, int)} with <code>sizeInBytes</code>
+ * less than or equal to the total buffer size
+ * may return a short actual transfer count.
*/
public void flush() {
if (mState == STATE_INITIALIZED) {