mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-02-28 12:29:59 +00:00
Prevent song resuming from outside of valid positions.
This commit is contained in:
parent
637d713883
commit
663758bb8a
@ -101,6 +101,7 @@ public class Media {
|
||||
|
||||
public void seekToTime(Duration millis) {
|
||||
int sampleNumber = (int) (millis.toMillis() * sampleRate / 1000);
|
||||
sampleNumber = Math.max(0, Math.min(sampleNumber, totalSamples));
|
||||
sampleBuffer.position(sampleNumber * (isStereo ? 2 : 1));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user