Cleanup content_playlist_update

This commit is contained in:
twinaphex 2015-05-26 06:52:00 +02:00
parent 18e68918f3
commit a19f6e21d8
2 changed files with 8 additions and 10 deletions

View File

@ -804,7 +804,6 @@ static int action_ok_core_deferred_set(const char *path,
path , core_display_name,
NULL);
content_playlist_write_file(playlist);
content_playlist_free(playlist);
menu->playlist = NULL;

View File

@ -124,26 +124,25 @@ void content_playlist_update(content_playlist_t *playlist, size_t idx,
const char *core_path, const char *core_name,
const char *crc32)
{
content_playlist_entry_t *entry = NULL;
if (!playlist)
return;
idx = idx - 1;
if (idx > playlist->size)
return;
entry = &playlist->entries[idx];
if (path != NULL)
playlist->entries[idx].path = strdup(path);
entry->path = strdup(path);
if (label != NULL)
playlist->entries[idx].label = strdup(label);
entry->label = strdup(label);
if (core_path != NULL)
{
playlist->entries[idx].core_path = strdup(core_path);
}
entry->core_path = strdup(core_path);
if (core_name != NULL)
{
playlist->entries[idx].core_name = strdup(core_name);
}
entry->core_name = strdup(core_name);
if (crc32 != NULL)
playlist->entries[idx].crc32 = strdup(crc32);
entry->crc32 = strdup(crc32);
}
/**