Set the no media flag in setCurrentSong rather than in getSong
Avoids an infinite loop on startup with no media
This commit is contained in:
parent
238beaaef6
commit
95b94f5921
@ -532,8 +532,10 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Song song = getSong(delta);
|
Song song = getSong(delta);
|
||||||
if (song == null)
|
if (song == null) {
|
||||||
|
setFlag(FLAG_NO_MEDIA);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (mSongTimeline) {
|
synchronized (mSongTimeline) {
|
||||||
mCurrentSong += delta;
|
mCurrentSong += delta;
|
||||||
@ -599,11 +601,9 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
|||||||
|
|
||||||
if (!song.populate()) {
|
if (!song.populate()) {
|
||||||
song.randomize();
|
song.randomize();
|
||||||
if (!song.populate()) {
|
if (!song.populate())
|
||||||
setFlag(FLAG_NO_MEDIA);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return song;
|
return song;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user