|
@@ -44,11 +44,23 @@ public class PlayBeanManager {
|
|
|
if (totalTime == -1) {
|
|
|
handleMusic(delayMillis,l);
|
|
|
} else {
|
|
|
- if (Math.abs(Math.abs(l - totalTime)-delayMillis) < next) {
|
|
|
- next =0;
|
|
|
+ long d = Math.abs(l - totalTime);
|
|
|
+ long d2 = Math.abs(d - delayMillis);
|
|
|
+ if (d2 < next) {
|
|
|
+ next = 0;
|
|
|
}
|
|
|
- if (Math.abs(l -totalTime) >= delayMillis) {
|
|
|
- handleMusic(delayMillis,l);
|
|
|
+ if (d >= delayMillis) {
|
|
|
+ handleMusic(delayMillis, l);
|
|
|
+ } else {
|
|
|
+ if (d2 <= 10) {
|
|
|
+ while (true) {
|
|
|
+ long s = System.currentTimeMillis();
|
|
|
+ if (Math.abs(s - totalTime) >= delayMillis) {
|
|
|
+ handleMusic(delayMillis, s);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
mHandler.postDelayed(mRunnable, next);
|