(playlist.c) Get rid of string_list usage

This commit is contained in:
libretroadmin 2024-06-15 14:15:36 +02:00
parent 01a7740f6f
commit 962737c85a

View File

@ -2790,32 +2790,32 @@ static bool playlist_read_file(playlist_t *playlist)
line_buf[3],
STRLEN_CONST("thumbnail_mode")) == 0)
{
char *tok, *save;
char thumbnail_mode_str[8] = {0};
struct string_list thumbnail_modes = {0};
char *thumbnail_mode_str_cpy = strdup(thumbnail_mode_str);
playlist_get_old_format_metadata_value(
line_buf[3], thumbnail_mode_str,
sizeof(thumbnail_mode_str));
string_list_initialize(&thumbnail_modes);
if (string_split_noalloc(&thumbnail_modes,
thumbnail_mode_str, "|"))
if ((tok = strtok_r(thumbnail_mode_str_cpy, "|", &save)))
{
if (thumbnail_modes.size == 2)
char *elem0 = strdup(tok);
if ((tok = strtok_r(NULL, "|", &save)))
{
/* Right thumbnail mode */
unsigned thumbnail_mode = string_to_unsigned(
thumbnail_modes.elems[0].data);
unsigned thumbnail_mode = string_to_unsigned(elem0);
if (thumbnail_mode <= PLAYLIST_THUMBNAIL_MODE_BOXARTS)
playlist->right_thumbnail_mode = (enum playlist_thumbnail_mode)thumbnail_mode;
/* Left thumbnail mode */
thumbnail_mode = string_to_unsigned(
thumbnail_modes.elems[1].data);
thumbnail_mode = string_to_unsigned(tok);
if (thumbnail_mode <= PLAYLIST_THUMBNAIL_MODE_BOXARTS)
playlist->left_thumbnail_mode = (enum playlist_thumbnail_mode)thumbnail_mode;
}
free(elem0);
}
string_list_deinitialize(&thumbnail_modes);
free(thumbnail_mode_str_cpy);
}
/* Get sort_mode */