mirror of
https://github.com/androidx/media.git
synced 2025-05-15 11:39:56 +08:00
Pragmatic fix for "stuck-in-ready-state" when seeking near the
end of some streams.
This commit is contained in:
parent
066334dad7
commit
d1360ad7d2
@ -479,7 +479,9 @@ public final class AudioTrack {
|
||||
|
||||
/** Returns whether enough data has been supplied via {@link #handleBuffer} to begin playback. */
|
||||
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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user