mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
playlist.c - use intfstream
This commit is contained in:
parent
61d3f90cae
commit
54ce2ec5e9
13
playlist.c
13
playlist.c
@ -22,6 +22,7 @@
|
|||||||
#include <boolean.h>
|
#include <boolean.h>
|
||||||
#include <compat/posix_string.h>
|
#include <compat/posix_string.h>
|
||||||
#include <string/stdstring.h>
|
#include <string/stdstring.h>
|
||||||
|
#include <streams/interface_stream.h>
|
||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
|
|
||||||
@ -494,19 +495,19 @@ static bool playlist_read_file(
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char buf[PLAYLIST_ENTRIES][1024];
|
char buf[PLAYLIST_ENTRIES][1024];
|
||||||
RFILE *file = filestream_open(
|
intfstream_t *file = intfstream_open_file(
|
||||||
path, RETRO_VFS_FILE_ACCESS_READ,
|
path, RETRO_VFS_FILE_ACCESS_READ,
|
||||||
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
RETRO_VFS_FILE_ACCESS_HINT_NONE);
|
||||||
|
|
||||||
for (i = 0; i < PLAYLIST_ENTRIES; i++)
|
|
||||||
buf[i][0] = '\0';
|
|
||||||
|
|
||||||
/* If playlist file does not exist,
|
/* If playlist file does not exist,
|
||||||
* create an empty playlist instead.
|
* create an empty playlist instead.
|
||||||
*/
|
*/
|
||||||
if (!file)
|
if (!file)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
for (i = 0; i < PLAYLIST_ENTRIES; i++)
|
||||||
|
buf[i][0] = '\0';
|
||||||
|
|
||||||
for (playlist->size = 0; playlist->size < playlist->cap; )
|
for (playlist->size = 0; playlist->size < playlist->cap; )
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -516,7 +517,7 @@ static bool playlist_read_file(
|
|||||||
char *last = NULL;
|
char *last = NULL;
|
||||||
*buf[i] = '\0';
|
*buf[i] = '\0';
|
||||||
|
|
||||||
if (!filestream_gets(file, buf[i], sizeof(buf[i])))
|
if (!intfstream_gets(file, buf[i], sizeof(buf[i])))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
/* Read playlist entry and terminate string with NUL character
|
/* Read playlist entry and terminate string with NUL character
|
||||||
@ -548,7 +549,7 @@ static bool playlist_read_file(
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
filestream_close(file);
|
intfstream_close(file);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user