forked from len0rd/rockbox
Fixed track changing in REPEAT_ONE mode and playlists with only one track. Removed previous workaround for this bug.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7284 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e9c35b17d0
commit
0812164ada
1 changed files with 8 additions and 25 deletions
|
|
@ -1265,19 +1265,21 @@ bool codec_request_next_track_callback(void)
|
||||||
|
|
||||||
/* Advance to next track. */
|
/* Advance to next track. */
|
||||||
if (ci.reload_codec && new_track > 0) {
|
if (ci.reload_codec && new_track > 0) {
|
||||||
if (!playlist_check(new_track))
|
if (!playlist_check(new_track)) {
|
||||||
|
ci.reload_codec = false;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
last_peek_offset--;
|
last_peek_offset--;
|
||||||
playlist_next(new_track);
|
playlist_next(new_track);
|
||||||
if (++track_ridx == MAX_TRACK)
|
if (++track_ridx == MAX_TRACK)
|
||||||
track_ridx = 0;
|
track_ridx = 0;
|
||||||
|
|
||||||
/* Wait for new track data (codectype 0 is invalid). When a correct
|
/* Wait for new track data (codectype 0 is invalid). When a correct
|
||||||
codectype is set, we can assume that the filesize is correct. */
|
codectype is set, we can assume that the filesize is correct. */
|
||||||
while (tracks[track_ridx].id3.codectype == 0 && filling
|
while (tracks[track_ridx].id3.codectype == 0 && filling
|
||||||
&& !ci.stop_codec)
|
&& !ci.stop_codec)
|
||||||
yield();
|
yield();
|
||||||
|
|
||||||
if (tracks[track_ridx].filesize == 0) {
|
if (tracks[track_ridx].filesize == 0) {
|
||||||
logf("Loading from disk...");
|
logf("Loading from disk...");
|
||||||
new_track = 0;
|
new_track = 0;
|
||||||
|
|
@ -1288,8 +1290,10 @@ bool codec_request_next_track_callback(void)
|
||||||
|
|
||||||
/* Advance to previous track. */
|
/* Advance to previous track. */
|
||||||
else if (ci.reload_codec && new_track < 0) {
|
else if (ci.reload_codec && new_track < 0) {
|
||||||
if (!playlist_check(new_track))
|
if (!playlist_check(new_track)) {
|
||||||
|
ci.reload_codec = false;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
last_peek_offset++;
|
last_peek_offset++;
|
||||||
playlist_next(new_track);
|
playlist_next(new_track);
|
||||||
if (--track_ridx < 0)
|
if (--track_ridx < 0)
|
||||||
|
|
@ -1373,26 +1377,9 @@ void audio_invalidate_tracks(void)
|
||||||
|
|
||||||
static void initiate_track_change(int peek_index)
|
static void initiate_track_change(int peek_index)
|
||||||
{
|
{
|
||||||
int repeat_mode = global_settings.repeat_mode;
|
|
||||||
|
|
||||||
if (!playlist_check(peek_index))
|
if (!playlist_check(peek_index))
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
/* Handle the special case of repeat mode and only
|
|
||||||
* one track, or REPEAT_ONE mode */
|
|
||||||
if ((repeat_mode == REPEAT_ONE) ||
|
|
||||||
((repeat_mode != REPEAT_OFF) && (playlist_amount() == 1))) {
|
|
||||||
if (!paused)
|
|
||||||
pcm_play_pause(false);
|
|
||||||
|
|
||||||
audio_ff_rewind(0);
|
|
||||||
|
|
||||||
if (!paused)
|
|
||||||
pcm_play_pause(true);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Detect if disk is spinning.. */
|
/* Detect if disk is spinning.. */
|
||||||
if (filling) {
|
if (filling) {
|
||||||
playlist_next(peek_index);
|
playlist_next(peek_index);
|
||||||
|
|
@ -1421,10 +1408,6 @@ void audio_thread(void)
|
||||||
queue_wait_w_tmo(&audio_queue, &ev, 0);
|
queue_wait_w_tmo(&audio_queue, &ev, 0);
|
||||||
switch (ev.id) {
|
switch (ev.id) {
|
||||||
case AUDIO_PLAY:
|
case AUDIO_PLAY:
|
||||||
/* Refuse to start playback if we are already playing
|
|
||||||
the requested track. */
|
|
||||||
if (last_index == playlist_get_display_index() && playing)
|
|
||||||
break ;
|
|
||||||
logf("starting...");
|
logf("starting...");
|
||||||
playing = true;
|
playing = true;
|
||||||
paused = false;
|
paused = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue