diff options
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 14ebb7a198..d17bf230a5 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -822,9 +822,6 @@ static int add_track_to_playlist(struct playlist_info* playlist, playlist->amount++; playlist->num_inserted_tracks++; - /* Update index for resume. */ - playlist_update_resume_index(); - return insert_position; } @@ -925,9 +922,6 @@ static int remove_track_from_playlist(struct playlist_info* playlist, sync_control(playlist, false); } - /* Update index for resume. */ - playlist_update_resume_index(); - return 0; } @@ -987,9 +981,6 @@ static int randomise_playlist(struct playlist_info* playlist, playlist->first_index, NULL, NULL, NULL); } - /* Update index for resume. */ - playlist_update_resume_index(); - return 0; } @@ -1030,9 +1021,6 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current, playlist->first_index, -1, NULL, NULL, NULL); } - /* Update index for resume. */ - playlist_update_resume_index(); - return 0; } @@ -1205,9 +1193,6 @@ static void find_and_set_playlist_index(struct playlist_info* playlist, break; } } - - /* Update index for resume. */ - playlist_update_resume_index(); } /* @@ -2486,6 +2471,12 @@ const char* playlist_peek(int steps, char* buf, size_t buf_size) if (index < 0) return NULL; +#if CONFIG_CODEC == SWCODEC + /* Just testing - don't care about the file name */ + if (!buf || !buf_size) + return ""; +#endif + control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK; seek = playlist->indices[index] & PLAYLIST_SEEK_MASK; @@ -2632,30 +2623,17 @@ int playlist_get_resume_info(int *resume_index) return 0; } -/* Get current playlist index. */ -int playlist_get_index(void) -{ - return current_playlist.index; -} - -/* Update resume index within playlist_info structure. */ -void playlist_update_resume_index(void) -{ - struct playlist_info* playlist = ¤t_playlist; - playlist->resume_index = playlist->index; -} - /* Update resume info for current playing song. Returns -1 on error. */ int playlist_update_resume_info(const struct mp3entry* id3) { struct playlist_info* playlist = ¤t_playlist; - + if (id3) { - if (global_status.resume_index != playlist->resume_index || + if (global_status.resume_index != playlist->index || global_status.resume_offset != id3->offset) { - global_status.resume_index = playlist->resume_index; + global_status.resume_index = playlist->index; global_status.resume_offset = id3->offset; status_save(); } @@ -3203,9 +3181,6 @@ 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. */ - playlist_update_resume_index(); - return result; } |