fix:修复返回上一曲会-1异常问题

This commit is contained in:
Yutousama 2022-06-11 23:54:44 +08:00
parent ed47603a29
commit b04bd7ca5a

View File

@ -363,6 +363,9 @@ public class MusicContainer {
tmpList.remove(0);
return;
}
if (playIndex < 0 || playIndex > playList.size()) {
playIndex = 0;
}
switch (playModel) {
case PLAY_MODEL_ORDER:
playOrder(false);
@ -384,6 +387,9 @@ public class MusicContainer {
*/
public void playPrevious() {
playIndex--;
if(playIndex<0){
playIndex=0;
}
MusicData data = previousPlayerList.getMusicData();
if (data != null) {
play(data);