Pragmatic fix for "stuck-in-ready-state" when seeking near the

end of some streams.
This commit is contained in:
Oliver Woodman 2015-02-13 19:26:49 +00:00
parent 066334dad7
commit d1360ad7d2

View File

@ -479,7 +479,9 @@ public final class AudioTrack {
/** Returns whether enough data has been supplied via {@link #handleBuffer} to begin playback. */ /** Returns whether enough data has been supplied via {@link #handleBuffer} to begin playback. */
public boolean hasEnoughDataToBeginPlayback() { public boolean hasEnoughDataToBeginPlayback() {
return submittedBytes >= minBufferSize; // The value of minBufferSize can be slightly less than what's actually required for playback
// to start, hence the multiplication factor.
return submittedBytes > (minBufferSize * 3) / 2;
} }
/** Sets the playback volume. */ /** Sets the playback volume. */