mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
parent
30011285bb
commit
250cab2dac
1 changed files with 3 additions and 3 deletions
|
|
@ -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. */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue