summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2023-01-21 16:28:30 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-01-23 12:24:12 +0000
commitfcb6239aba523f054662e090bdcb4cb82148e450 (patch)
tree723ba06b34486ef0d78337426da92b5cbf0b16dd
parentdd2a0aeab03aa3f014411ef63d08d295a45cc3de (diff)
downloadrockbox-fcb6239aba.tar.gz
rockbox-fcb6239aba.zip
playlist: Remove current flag
Only current_playlist will have it set, so compare pointers instead. Change-Id: I46dc7baef9699990962176db7c8796bba1e4809d
-rw-r--r--apps/playlist.c7
-rw-r--r--apps/playlist.h1
2 files changed, 3 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 7bdcafa69a..77e3d20151 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -560,7 +560,7 @@ static void empty_playlist_unlocked(struct playlist_info* playlist, bool resume)
playlist->pending_control_sync = false;
playlist->shuffle_modified = false;
- if (!resume && playlist->current)
+ if (!resume && playlist == &current_playlist)
{
/* start with fresh playlist control file when starting new
playlist */
@@ -650,7 +650,8 @@ static void new_playlist_unlocked(struct playlist_info* playlist,
{
fileused = "";
- if (dirused && playlist->current) /* !current cannot be in_ram */
+ /* only the current playlist can be in RAM */
+ if (dirused && playlist == &current_playlist)
playlist->in_ram = true;
else
dirused = ""; /* empty playlist */
@@ -2076,7 +2077,6 @@ void playlist_init(void)
int handle;
struct playlist_info* playlist = &current_playlist;
- playlist->current = true;
strmemccpy(playlist->control_filename, PLAYLIST_CONTROL_FILE,
sizeof(playlist->control_filename));
playlist->fd = -1;
@@ -2201,7 +2201,6 @@ int playlist_create_ex(struct playlist_info* playlist,
{
/* Initialize playlist structure */
int r = rand() % 10;
- playlist->current = false;
/* Use random name for control file */
snprintf(playlist->control_filename, sizeof(playlist->control_filename),
diff --git a/apps/playlist.h b/apps/playlist.h
index 86c0c293ab..5a8f3ec360 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -75,7 +75,6 @@ struct playlist_control_cache {
struct playlist_info
{
- bool current; /* current playing playlist */
bool utf8; /* playlist is in .m3u8 format */
bool control_created; /* has control file been created? */
bool in_ram; /* playlist stored in ram (dirplay) */