我有一种我无法理解的奇怪情况。我设置了一个寻找MediaPlayer,调用.play(),搜索将在10秒内完成。代码:
Log.d(TAG, "start: seek before start " + mediaPlayer.getCurrentPosition());
mediaPlayer.start();
Log.d(TAG, "start: current seek right after start " + mediaPlayer.getCurrentPosition());
try { Thread.sleep(50);
} catch (InterruptedException ignored) {}
Log.d(TAG, "start: current seek after 50 ms after start is " + mediaPlayer.getCurrentPosition());
在日志中我们有下一个:
D/PlayerActivity﹕ start: seek before start 449586
D/PlayerActivity﹕ start: current seek right after start 0
D/PlayerActivity﹕ start: current seek after 50 ms after start is 457883
我无法理解为什么它会在10秒内前进? 感谢。
答案 0 :(得分:0)
似乎根本原因是mp3文件中的错误metainf。与MediaPlayer没有任何关系......