Create playlist in playlist_read_file if it doesn't already

exist
This commit is contained in:
twinaphex 2014-09-15 04:45:57 +02:00
parent c6469c8341
commit 5e43f375c6

View File

@ -235,6 +235,13 @@ end:
return true;
}
static void playlist_create_new(const char *path)
{
FILE *file = fopen(path, "w");
if (file)
fclose(file);
}
content_playlist_t *content_playlist_init(const char *path, size_t size)
{
RARCH_LOG("Opening playlist: %s.\n", path);
@ -253,6 +260,9 @@ content_playlist_t *content_playlist_init(const char *path, size_t size)
playlist->cap = size;
if (!path_file_exists(path))
playlist_create_new(path);
if (!content_playlist_read_file(playlist, path))
goto error;