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