diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-30 12:24:02 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-10-28 14:54:02 -0400 |
commit | 90e35716e312b9446515263f75e9e7cb66483c2c (patch) | |
tree | be7a60fd2e1934a3a5bcaf75d455e5c8752c4e26 /apps/playlist.h | |
parent | 1ee152b5a45b907958511e5477e0f8f18458fc15 (diff) | |
download | rockbox-90e35716e312b9446515263f75e9e7cb66483c2c.tar.gz rockbox-90e35716e312b9446515263f75e9e7cb66483c2c.zip |
playlist: Rewrite playlist_save(), optimization & fixes
playlist_save() was a poorly thought out mess. This fixes the
glaring issues and hopefully ensures that saving the playlist
never loses state (such as queued tracks or modified status)
after save+resume.
Indices are now updated on the fly, which is faster and needs
no extra memory. But if an error occurs, the playlist will be
corrupted. There is currently no attempt to handle this since
errors should be unlikely, but some error handling needs to be
added in the future.
Change-Id: If8a5dbd6a596460be08ee0b7bab9f24337886ea4
Diffstat (limited to 'apps/playlist.h')
-rw-r--r-- | apps/playlist.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/apps/playlist.h b/apps/playlist.h index 101a3c1207..0dc5148acd 100644 --- a/apps/playlist.h +++ b/apps/playlist.h | |||
@@ -177,8 +177,7 @@ size_t playlist_get_required_bufsz(struct playlist_info* playlist, | |||
177 | bool include_namebuf, int num_indices); | 177 | bool include_namebuf, int num_indices); |
178 | int playlist_get_track_info(struct playlist_info* playlist, int index, | 178 | int playlist_get_track_info(struct playlist_info* playlist, int index, |
179 | struct playlist_track_info* info); | 179 | struct playlist_track_info* info); |
180 | int playlist_save(struct playlist_info* playlist, char *filename, | 180 | int playlist_save(struct playlist_info* playlist, char *filename); |
181 | void* temp_buffer, size_t temp_buffer_size); | ||
182 | int playlist_directory_tracksearch(const char* dirname, bool recurse, | 181 | int playlist_directory_tracksearch(const char* dirname, bool recurse, |
183 | int (*callback)(char*, void*), | 182 | int (*callback)(char*, void*), |
184 | void* context); | 183 | void* context); |