Fix AudioTrack typos.

Issue: #479
This commit is contained in:
Oliver Woodman 2015-05-22 20:39:28 +01:00
parent 30011285bb
commit 250cab2dac

View file

@ -449,7 +449,7 @@ public final class AudioTrack {
// This is the first time we've seen this {@code buffer}. // This is the first time we've seen this {@code buffer}.
// Note: presentationTimeUs corresponds to the end of the sample, not the start. // Note: presentationTimeUs corresponds to the end of the sample, not the start.
long bufferStartTime = presentationTimeUs - framesToDurationUs(bytesToFrames(size)); long bufferStartTime = presentationTimeUs - framesToDurationUs(bytesToFrames(size));
if (startMediaTimeUs == START_NOT_SET) { if (startMediaTimeState == START_NOT_SET) {
startMediaTimeUs = Math.max(0, bufferStartTime); startMediaTimeUs = Math.max(0, bufferStartTime);
startMediaTimeState = START_IN_SYNC; startMediaTimeState = START_IN_SYNC;
} else { } else {
@ -573,7 +573,7 @@ public final class AudioTrack {
if (isInitialized()) { if (isInitialized()) {
submittedBytes = 0; submittedBytes = 0;
temporaryBufferSize = 0; temporaryBufferSize = 0;
startMediaTimeUs = START_NOT_SET; startMediaTimeState = START_NOT_SET;
latencyUs = 0; latencyUs = 0;
resetSyncParams(); resetSyncParams();
int playState = audioTrack.getPlayState(); int playState = audioTrack.getPlayState();
@ -623,7 +623,7 @@ public final class AudioTrack {
/** Returns whether {@link #getCurrentPositionUs} can return the current playback position. */ /** Returns whether {@link #getCurrentPositionUs} can return the current playback position. */
private boolean hasCurrentPositionUs() { private boolean hasCurrentPositionUs() {
return isInitialized() && startMediaTimeUs != START_NOT_SET; return isInitialized() && startMediaTimeState != START_NOT_SET;
} }
/** Updates the audio track latency and playback position parameters. */ /** Updates the audio track latency and playback position parameters. */