1
0
Fork 0
forked from len0rd/rockbox
foxbox/apps
Christian Soffke 7592d2ca5e playlist: deprecate PLAYLIST_COMMAND_CLEAR
In the following scenario, a garbage file name would
be written to the control file for the playing track
(resulting in a failure to resume correctly):

- "Keep Current Track When Replacing Playlist" option is set
- A track is playing that was not inserted but instead comes
  from a playlist file on disk
- User performs "Playing Next..." -> "Play" on some tracks, so
  that the current playlist is replaced (but leaving the playing
  track queued)
- User saves the playlist while queued track is still playing
  (the offer to remove queued tracks is declined)

The failure occurs because the pl_save_update_control function
assumes that the seek offset for queued files always points into
the control file. Meanwhile, the remove_all_tracks_unlocked
function adds the PLAYLIST_QUEUED flag indiscriminately, even if
a track comes from a playlist file instead of having been inserted.

Theoretically, this could be addressed by adding the playing
track's file name as a parameter to PLAYLIST_COMMAND_CLEAR,
which the track is then updated to point to, unless it
was already inserted (alternatively, we could seek within
the playlist file for such tracks).

Unless I'm missing something, it may be preferable, though, to
get rid of PLAYLIST_COMMAND_CLEAR completely, and instead have the
remove_all_tracks_unlocked function start over with a fresh
control file, into which we insert a single ('P' and) 'Q' command.

This seems to have several advantages:

- When resuming, we eliminate the need to parse and handle all of
  the outdated entries again that end up being cleared anyway
- It is ensured that the control file doesn't rely on the existence
  of a playlist file anymore after the playlist has been cleared
- We can reset the playlist's file name, which should make it less
  likely for the user to overwrite their previous (now unconnected)
  playlist that was still displayed in the Save dialog
- Unrelated bookmarks for the previous playlist aren't displayed
  anymore
- Improved consistency with existing behavior when the "Keep
  Current Track When Replacing Playlist" was disabled.

Change-Id: I41a89295bbac878807d65db9cf67b8a485daf0e5
2024-10-26 11:28:01 -04:00
..
bitmaps Rename symbols of FiiO M3K Linux-based port 2021-02-27 23:53:28 +00:00
gui janitorial: Use ATTRIBUTE_PRINTF(X,Y) instead of __attribute__((format(printf,X,Y))) 2024-10-17 21:39:41 -04:00
hosted/android [FixRed] android yesno dialog 2023-10-01 12:21:54 -04:00
iap [Feature] playlist_viewer id3 title display 2024-07-09 01:40:02 -04:00
keymaps agptekrocker: Fix manual build due to missing Quickscreen enter/exit 2024-07-12 08:52:24 -04:00
lang Translation updates 2024-10-22 06:48:35 -04:00
menus Add reset EQ menu option 2024-10-16 17:20:27 +01:00
plugins plugins: playing time: OBOE 2024-10-18 06:55:15 +02:00
radio list: remove redundant setting of icon callback to NULL 2024-07-28 15:33:11 +02:00
recorder Ignore zero bytes between markers in built-in jpeg decoder 2024-10-23 21:17:35 -04:00
abrepeat.c [Cleanup] abrepeat.c 2024-06-20 11:14:27 -04:00
abrepeat.h [Cleanup] abrepeat.c 2024-06-20 11:14:27 -04:00
action.c Fix prev/next folder action leads to immediate ff/rewind 2024-10-22 16:28:22 +03:00
action.h apps: Move action_cur_t and action_last_t to action.c 2024-04-21 20:37:26 -04:00
alarm_menu.c voice: Revert one of the changes made in b6053c4d54 2024-05-19 21:05:43 -04:00
alarm_menu.h Fix menu warnings 2018-10-18 00:06:31 +02:00
appevents.h Get voice event out of playback.c 2017-12-12 20:28:56 -05:00
applimits.h
apps.make makefiles: Suppress stray backslash warnings with grep 3.8 2023-03-21 04:48:31 -04:00
audio_path.c nwza860: fix simulator build 2020-10-19 03:39:33 +00:00
audio_thread.c Get voice event out of playback.c 2017-12-12 20:28:56 -05:00
audio_thread.h Update software recording engine to latest codec interface. 2013-06-30 00:40:27 +02:00
beep.c Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
bookmark.c [coverity] bookmark.c fix add_bookmark & false positive in remove_bookmark 2024-06-02 12:42:45 -04:00
bookmark.h Fix return to root after selecting items from playlist viewer 2022-11-19 10:01:23 +01:00
buffering.c [Feature] playlist_viewer id3 title display 2024-07-09 01:40:02 -04:00
buffering.h buffering: remove bufgettail/bufcuttail 2022-04-20 16:51:49 -04:00
codec_thread.c codec_thread.c don't overrun audio_formats[] array 2021-08-11 10:56:14 -04:00
codec_thread.h Update software recording engine to latest codec interface. 2013-06-30 00:40:27 +02:00
codecs.c plugins: Simplify plugin/codec API versioning 2023-03-21 16:23:54 -04:00
core_asmdefs.c
core_keymap.c Add core_get_data_pinned(), use it where possible 2023-01-15 08:57:45 -05:00
core_keymap.h key remap: simplify and use movable allocations 2022-09-25 11:05:59 +01:00
cuesheet.c [coverity] cuesheet.c search_for_cursheet() if no dot strcpy to NULL 2024-06-02 21:48:00 -04:00
cuesheet.h [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
debug_menu.c ipod6g: Reworking the bespoke ATA driver 2024-10-17 20:30:37 -04:00
debug_menu.h Fix menu warnings 2018-10-18 00:06:31 +02:00
enc_config.c Settings: Rename INT/BOOL setting type enum to RB_INT/RB_BOOL 2023-09-22 10:00:46 -04:00
enc_config.h Fix menu warnings 2018-10-18 00:06:31 +02:00
features.txt features: Add 'sd_storage' if the device uses SD cards 2024-09-21 10:48:24 -04:00
fileop.c fileop: Prevent poweroff during move 2024-08-11 19:33:05 +02:00
fileop.h [Cleanup] onplay.c fileop.c 2024-07-04 12:44:04 -04:00
filetree.c [Feature/BugFix] Dirplay never gets the file I selected 2024-09-26 03:29:15 -04:00
filetree.h Replace "Reload After Saving" with option to remove queued tracks 2024-04-21 18:28:16 +02:00
filetypes.c [Bugfix/Feature] OpenPlugin and default plugins 2024-05-09 16:13:24 -04:00
filetypes.h [Bugfix/Feature] OpenPlugin and default plugins 2024-05-09 16:13:24 -04:00
fracmul.h
keyboard.h [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice. 2020-07-24 21:20:13 +00:00
language.c [coverity] language.c lang_load() check bytes read for headers 2024-06-02 22:07:02 -04:00
language.h lang: Support languages that speak the units before a numerical value 2023-05-22 10:30:13 -04:00
logfdisp.c misc.c open_pathfmt caller supplied buffer 2022-11-23 22:09:46 -05:00
logfdisp.h
main.c Add DeviceData to bootloaders 2024-09-02 13:29:43 -04:00
menu.c touchscreen: Fix menu callbacks in touchscreen pointing mode 2024-04-21 20:37:47 -04:00
menu.h menus remove reserved 'param' parameter 2022-12-17 04:24:37 -05:00
misc.c storage: 64-bit sector offsets 2024-08-12 14:23:44 -04:00
misc.h storage: 64-bit sector offsets 2024-08-12 14:23:44 -04:00
onplay.c codestyle changes on g5911 2024-09-04 10:58:24 -04:00
onplay.h Reworks to the shuffle system to improve performance and allow fast shuffling from a big library (but this work for all database views) 2024-08-31 10:44:20 -04:00
open_plugin.c [Bugfix/Feature] OpenPlugin and default plugins 2024-05-09 16:13:24 -04:00
open_plugin.h open_plugin.c access open_plugin_entry through a function 2022-12-16 09:05:06 -05:00
pcmbuf.c [BugFix] Playback.c OOM with large voice file 2024-09-24 10:47:34 -04:00
pcmbuf.h [BugFix] Playback.c OOM with large voice file 2024-09-24 10:47:34 -04:00
playback.c sdlapp: Fix build with SDL2 2024-10-07 12:36:44 -04:00
playback.h setting_list.c playback frequency cleanup 2023-09-01 19:32:27 -04:00
playlist.c playlist: deprecate PLAYLIST_COMMAND_CLEAR 2024-10-26 11:28:01 -04:00
playlist.h Playlist viewer: Add new options to allow formatting using tags 2024-09-09 18:21:38 -04:00
playlist_catalog.c voice: Correct all uses of spashf() with an ID2P() argument 2024-05-19 21:05:43 -04:00
playlist_catalog.h Suggest numbered filename when saving untitled playlist 2023-10-28 18:24:00 -04:00
playlist_menu.h
playlist_viewer.c Playlist viewer: Add new options to allow formatting using tags 2024-09-09 18:21:38 -04:00
playlist_viewer.h Playlist Catalogue: Restore selection in playlist 2022-11-26 17:20:06 +01:00
plugin.c plugin load / tagtree retrieval: eliminate storage_disk_is_active check 2024-10-14 09:27:26 -04:00
plugin.h storage: 64-bit sector offsets 2024-08-12 14:23:44 -04:00
rbcodec_helpers.c Remove buflib allocation names, part two 2023-01-13 10:32:54 +00:00
rbcodecconfig.h kernel: Break out kernel primitives into separate files and move to separate dir. 2014-03-03 18:11:57 +01:00
rbcodecplatform.h rbcodec: abstract tdspeed buffer allocation 2012-05-07 10:29:07 +02:00
README
root_menu.c Offer choice of default browsers 2024-04-24 05:05:42 +02:00
root_menu.h Add open_plugin to core 2020-08-17 10:15:14 -04:00
screen_access.c make splash split on control characters 2022-11-12 06:22:16 -05:00
screen_access.h make splash split on control characters 2022-11-12 06:22:16 -05:00
screens.c list: remove redundant setting of icon callback to NULL 2024-07-28 15:33:11 +02:00
screens.h Fix warble error 4cfd7cc 2023-10-19 21:16:12 +02:00
settings.c [coverity] settings.c int_to_string() string_to_int() guard NULL deref 2024-06-07 00:25:48 -04:00
settings.h Playlist viewer: Add new options to allow formatting using tags 2024-09-09 18:21:38 -04:00
settings_list.c Playlist viewer: Add new options to allow formatting using tags 2024-09-09 18:21:38 -04:00
settings_list.h [BugFix] F_CB_ONLY_IF_CHANGED Overlapped NVRAM 2023-09-13 23:25:05 -04:00
shortcuts.c Remove static buffer from shortcts.c 2024-09-13 11:22:46 -04:00
shortcuts.h shortcuts: add 'reboot' type 2024-05-13 18:06:55 +02:00
sound_menu.h Fix menu warnings 2018-10-18 00:06:31 +02:00
SOURCES [Feature] onplay.c show file progress 2024-06-30 02:09:40 -04:00
status.c [2/4] get rid of HAVE_LCD_CHARCELLS 2020-07-24 21:20:13 +00:00
status.h Add a comment about the ordering of 'enum playmode' 2022-11-23 10:08:49 -05:00
tagcache.c [BugFix] tagcache_search() must be closed with tagcache_search_finish() 2024-09-25 01:33:47 -04:00
tagcache.h [Feature] db_commit plugin allows a more verbose commit 2023-10-05 21:24:37 -04:00
tagnavi.config lang: Replace all <...> with [...] 2024-09-17 10:21:46 -04:00
tagtree.c plugin load / tagtree retrieval: eliminate storage_disk_is_active check 2024-10-14 09:27:26 -04:00
tagtree.h Reworks to the shuffle system to improve performance and allow fast shuffling from a big library (but this work for all database views) 2024-08-31 10:44:20 -04:00
talk.c [Bugfix] Enable Progressive loading for talk clips on devices <= 8MB 2024-09-25 00:54:10 -04:00
talk.h talk: Voice the volume name when browsing and when voicing full paths 2024-07-28 16:54:33 -04:00
tree.c tree.c remove strlcat in favor of strmemccpy 2024-09-26 00:38:54 -04:00
tree.h Reworks to the shuffle system to improve performance and allow fast shuffling from a big library (but this work for all database views) 2024-08-31 10:44:20 -04:00
usb_keymaps.c Document intentional fallthroughs + fix harmless unintended ones 2021-08-04 18:59:46 +00:00
usb_keymaps.h
voice_thread.c Remove buflib allocation names, part two 2023-01-13 10:32:54 +00:00
voice_thread.h voice: Allow voice prompt volume to be configurable 2021-03-07 12:51:36 +00:00

For general information see: docs/README
For API information see: docs/API