1
0
Fork 0
forked from len0rd/rockbox

Fix regressions of r29682. Update playlist index resume position when playlist changes (e.g. shuffling, inserting, removing, ...).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29690 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2011-04-07 20:33:00 +00:00
parent 37990206dd
commit 4df825be43
3 changed files with 27 additions and 0 deletions

View file

@ -233,6 +233,14 @@ static void audio_stop_playback(void);
/**************************************/
/** Playlist callback */
/* This callback is required to update the resume index in case of changing
* a playlist and pausing/resuming before the next track change. */
void playback_set_playlist_index(int index)
{
thistrack_id3->index = index;
}
/** Pcmbuf callbacks */

View file

@ -67,6 +67,7 @@ long audio_filebufused(void);
void audio_pre_ff_rewind(void);
void audio_skip(int direction);
void audio_hard_stop(void); /* Stops audio from serving playback */
void playback_set_playlist_index(int index);
#ifdef HAVE_CROSSFADE
void audio_set_crossfade(int enable);
#endif

View file

@ -820,6 +820,9 @@ static int add_track_to_playlist(struct playlist_info* playlist,
playlist->amount++;
playlist->num_inserted_tracks++;
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
return insert_position;
}
@ -920,6 +923,9 @@ static int remove_track_from_playlist(struct playlist_info* playlist,
sync_control(playlist, false);
}
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
return 0;
}
@ -979,6 +985,9 @@ static int randomise_playlist(struct playlist_info* playlist,
playlist->first_index, NULL, NULL, NULL);
}
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
return 0;
}
@ -1019,6 +1028,9 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
playlist->first_index, -1, NULL, NULL, NULL);
}
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
return 0;
}
@ -1191,6 +1203,9 @@ static void find_and_set_playlist_index(struct playlist_info* playlist,
break;
}
}
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
}
/*
@ -3174,6 +3189,9 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0);
#endif
/* Update index for resume. */
playback_set_playlist_index(playlist->index);
return result;
}