forked from len0rd/rockbox
playlist: Remove current flag
Only current_playlist will have it set, so compare pointers instead. Change-Id: I46dc7baef9699990962176db7c8796bba1e4809d
This commit is contained in:
parent
dd2a0aeab0
commit
fcb6239aba
2 changed files with 3 additions and 5 deletions
|
|
@ -560,7 +560,7 @@ static void empty_playlist_unlocked(struct playlist_info* playlist, bool resume)
|
||||||
playlist->pending_control_sync = false;
|
playlist->pending_control_sync = false;
|
||||||
playlist->shuffle_modified = false;
|
playlist->shuffle_modified = false;
|
||||||
|
|
||||||
if (!resume && playlist->current)
|
if (!resume && playlist == ¤t_playlist)
|
||||||
{
|
{
|
||||||
/* start with fresh playlist control file when starting new
|
/* start with fresh playlist control file when starting new
|
||||||
playlist */
|
playlist */
|
||||||
|
|
@ -650,7 +650,8 @@ static void new_playlist_unlocked(struct playlist_info* playlist,
|
||||||
{
|
{
|
||||||
fileused = "";
|
fileused = "";
|
||||||
|
|
||||||
if (dirused && playlist->current) /* !current cannot be in_ram */
|
/* only the current playlist can be in RAM */
|
||||||
|
if (dirused && playlist == ¤t_playlist)
|
||||||
playlist->in_ram = true;
|
playlist->in_ram = true;
|
||||||
else
|
else
|
||||||
dirused = ""; /* empty playlist */
|
dirused = ""; /* empty playlist */
|
||||||
|
|
@ -2076,7 +2077,6 @@ void playlist_init(void)
|
||||||
int handle;
|
int handle;
|
||||||
struct playlist_info* playlist = ¤t_playlist;
|
struct playlist_info* playlist = ¤t_playlist;
|
||||||
|
|
||||||
playlist->current = true;
|
|
||||||
strmemccpy(playlist->control_filename, PLAYLIST_CONTROL_FILE,
|
strmemccpy(playlist->control_filename, PLAYLIST_CONTROL_FILE,
|
||||||
sizeof(playlist->control_filename));
|
sizeof(playlist->control_filename));
|
||||||
playlist->fd = -1;
|
playlist->fd = -1;
|
||||||
|
|
@ -2201,7 +2201,6 @@ int playlist_create_ex(struct playlist_info* playlist,
|
||||||
{
|
{
|
||||||
/* Initialize playlist structure */
|
/* Initialize playlist structure */
|
||||||
int r = rand() % 10;
|
int r = rand() % 10;
|
||||||
playlist->current = false;
|
|
||||||
|
|
||||||
/* Use random name for control file */
|
/* Use random name for control file */
|
||||||
snprintf(playlist->control_filename, sizeof(playlist->control_filename),
|
snprintf(playlist->control_filename, sizeof(playlist->control_filename),
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ struct playlist_control_cache {
|
||||||
|
|
||||||
struct playlist_info
|
struct playlist_info
|
||||||
{
|
{
|
||||||
bool current; /* current playing playlist */
|
|
||||||
bool utf8; /* playlist is in .m3u8 format */
|
bool utf8; /* playlist is in .m3u8 format */
|
||||||
bool control_created; /* has control file been created? */
|
bool control_created; /* has control file been created? */
|
||||||
bool in_ram; /* playlist stored in ram (dirplay) */
|
bool in_ram; /* playlist stored in ram (dirplay) */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue