mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
playlist.c - some optimizations
This commit is contained in:
parent
df7513be27
commit
cda840683b
10
playlist.c
10
playlist.c
@ -381,22 +381,23 @@ void playlist_write_file(playlist_t *playlist)
|
|||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
RFILE *file = NULL;
|
RFILE *file = NULL;
|
||||||
|
FILE *fp = NULL;
|
||||||
|
|
||||||
if (!playlist || !playlist->modified)
|
if (!playlist || !playlist->modified)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
file = filestream_open(playlist->conf_path, RFILE_MODE_WRITE, -1);
|
file = filestream_open(playlist->conf_path, RFILE_MODE_WRITE, -1);
|
||||||
|
|
||||||
RARCH_LOG("Trying to write to playlist file: %s\n", playlist->conf_path);
|
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
RARCH_ERR("Failed to write to playlist file: %s\n", playlist->conf_path);
|
RARCH_ERR("Failed to write to playlist file: %s\n", playlist->conf_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fp = filestream_get_fp(file);
|
||||||
|
|
||||||
for (i = 0; i < playlist->size; i++)
|
for (i = 0; i < playlist->size; i++)
|
||||||
fprintf(filestream_get_fp(file), "%s\n%s\n%s\n%s\n%s\n%s\n",
|
fprintf(fp, "%s\n%s\n%s\n%s\n%s\n%s\n",
|
||||||
playlist->entries[i].path ? playlist->entries[i].path : "",
|
playlist->entries[i].path ? playlist->entries[i].path : "",
|
||||||
playlist->entries[i].label ? playlist->entries[i].label : "",
|
playlist->entries[i].label ? playlist->entries[i].label : "",
|
||||||
playlist->entries[i].core_path,
|
playlist->entries[i].core_path,
|
||||||
@ -406,6 +407,9 @@ void playlist_write_file(playlist_t *playlist)
|
|||||||
);
|
);
|
||||||
|
|
||||||
playlist->modified = false;
|
playlist->modified = false;
|
||||||
|
|
||||||
|
RARCH_LOG("Written to playlist file: %s\n", playlist->conf_path);
|
||||||
|
|
||||||
filestream_close(file);
|
filestream_close(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user