Start making the other code safe that is dependent on menu driver

ident checking
This commit is contained in:
twinaphex 2020-03-04 20:47:39 +01:00
parent 2f25db03ba
commit 32e4aea068
9 changed files with 152 additions and 130 deletions

View File

@ -381,8 +381,8 @@ int generic_action_ok_displaylist_push(const char *path,
const char *info_path = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
const char *menu_ident = menu_driver_ident();
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
char *menu_driver = settings->arrays.menu_driver;
#ifdef HAVE_AUDIOMIXER
bool audio_enable_menu = settings->bools.audio_enable_menu;
bool audio_enable_menu_ok = settings->bools.audio_enable_menu_ok;
@ -390,7 +390,7 @@ int generic_action_ok_displaylist_push(const char *path,
const char *dir_menu_content = settings->paths.directory_menu_content;
const char *dir_libretro = settings->paths.directory_libretro;
if (!menu || string_is_equal(menu_driver, "null"))
if (!menu || string_is_equal(menu_ident, "null"))
{
menu_displaylist_info_free(&info);
return menu_cbs_exit();

View File

@ -100,7 +100,15 @@ int action_scan_directory(const char *path,
int action_switch_thumbnail(const char *path,
const char *label, unsigned type, size_t idx)
{
settings_t *settings = config_get_ptr();
const char *menu_ident = menu_driver_ident();
settings_t *settings = config_get_ptr();
bool special_case = false;
#ifdef HAVE_RGUI
special_case = !string_is_equal(menu_ident, "rgui");
#endif
#ifdef HAVE_MATERIALUI
special_case = special_case && !string_is_equal(menu_ident, "glui");
#endif
if (!settings)
return -1;
@ -113,8 +121,7 @@ int action_switch_thumbnail(const char *path,
* changing thumbnail view mode.
* For other menu drivers, we cycle through available thumbnail
* types. */
if (!string_is_equal(settings->arrays.menu_driver, "rgui") &&
!string_is_equal(settings->arrays.menu_driver, "glui"))
if (special_case)
{
settings->uints.menu_left_thumbnails++;
if (settings->uints.menu_left_thumbnails > 3)
@ -131,8 +138,7 @@ int action_switch_thumbnail(const char *path,
* changing thumbnail view mode.
* For other menu drivers, we cycle through available thumbnail
* types. */
if (!string_is_equal(settings->arrays.menu_driver, "rgui") &&
!string_is_equal(settings->arrays.menu_driver, "glui"))
if (special_case)
{
settings->uints.gfx_thumbnails++;
if (settings->uints.gfx_thumbnails > 3)

View File

@ -1064,14 +1064,19 @@ static int action_bind_sublabel_playlist_entry(
const char *label, const char *path,
char *s, size_t len)
{
settings_t *settings = config_get_ptr();
playlist_t *playlist = NULL;
const struct playlist_entry *entry = NULL;
const char *menu_ident = menu_driver_ident();
settings_t *settings = config_get_ptr();
bool playlist_show_sublabels = settings->bools.playlist_show_sublabels;
unsigned playlist_sublabel_runtime_type = settings->uints.playlist_sublabel_runtime_type;
bool content_runtime_log = settings->bools.content_runtime_log;
bool content_runtime_log_aggregate = settings->bools.content_runtime_log_aggregate;
if (!settings->bools.playlist_show_sublabels)
if (!playlist_show_sublabels)
return 0;
#ifdef HAVE_OZONE
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
if (string_is_equal(menu_ident, "ozone"))
return 0;
#endif
@ -1100,10 +1105,10 @@ static int action_bind_sublabel_playlist_entry(
/* Get runtime info *if* required runtime log is enabled
* *and* this is a valid playlist type */
if (((settings->uints.playlist_sublabel_runtime_type == PLAYLIST_RUNTIME_PER_CORE) &&
!settings->bools.content_runtime_log) ||
((settings->uints.playlist_sublabel_runtime_type == PLAYLIST_RUNTIME_AGGREGATE) &&
!settings->bools.content_runtime_log_aggregate))
if (((playlist_sublabel_runtime_type == PLAYLIST_RUNTIME_PER_CORE) &&
!content_runtime_log) ||
((playlist_sublabel_runtime_type == PLAYLIST_RUNTIME_AGGREGATE) &&
!content_runtime_log_aggregate))
return 0;
/* Note: This looks heavy, but each string_is_equal() call will
@ -2100,50 +2105,54 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_timedate_style);
break;
case MENU_ENUM_LABEL_THUMBNAILS:
settings = config_get_ptr();
#ifdef HAVE_RGUI
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
}
else
const char *menu_ident = menu_driver_ident();
#ifdef HAVE_RGUI
if (string_is_equal(menu_ident, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
}
else
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
}
else
if (string_is_equal(menu_ident, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
}
else
#endif
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
}
}
break;
case MENU_ENUM_LABEL_LEFT_THUMBNAILS:
settings = config_get_ptr();
#ifdef HAVE_RGUI
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
}
else
const char *menu_ident = menu_driver_ident();
#ifdef HAVE_RGUI
if (string_is_equal(menu_ident, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
}
else
#endif
#ifdef HAVE_OZONE
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
}
else
if (string_is_equal(menu_ident, "ozone"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
}
else
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
}
else
if (string_is_equal(menu_ident, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
}
else
#endif
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
}
}
break;
case MENU_ENUM_LABEL_MENU_THUMBNAIL_UPSCALE_THRESHOLD:
@ -2898,52 +2907,56 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_playlist_manager_clean_playlist);
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_RIGHT_THUMBNAIL_MODE:
settings = config_get_ptr();
/* Uses same sublabels as MENU_ENUM_LABEL_THUMBNAILS */
#ifdef HAVE_RGUI
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
}
else
const char *menu_ident = menu_driver_ident();
/* Uses same sublabels as MENU_ENUM_LABEL_THUMBNAILS */
#ifdef HAVE_RGUI
if (string_is_equal(menu_ident, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_rgui);
}
else
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
}
else
if (string_is_equal(menu_ident, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails_materialui);
}
else
#endif
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_thumbnails);
}
}
break;
case MENU_ENUM_LABEL_PLAYLIST_MANAGER_LEFT_THUMBNAIL_MODE:
settings = config_get_ptr();
/* Uses same sublabels as MENU_ENUM_LABEL_LEFT_THUMBNAILS */
#ifdef HAVE_RGUI
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
}
else
const char *menu_ident = menu_driver_ident();
/* Uses same sublabels as MENU_ENUM_LABEL_LEFT_THUMBNAILS */
#ifdef HAVE_RGUI
if (string_is_equal(menu_ident, "rgui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_rgui);
}
else
#endif
#ifdef HAVE_OZONE
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
}
else
if (string_is_equal(menu_ident, "ozone"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_ozone);
}
else
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
}
else
if (string_is_equal(menu_ident, "glui"))
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails_materialui);
}
else
#endif
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_left_thumbnails);
}
}
break;
case MENU_ENUM_LABEL_DELETE_PLAYLIST:

View File

@ -94,17 +94,15 @@ static int action_get_title_thumbnails(
{
const char *title = NULL;
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS;
#if defined(HAVE_RGUI) || defined(HAVE_MATERIALUI)
settings_t *settings = config_get_ptr();
const char *menu_ident = menu_driver_ident();
/* Get label value */
#ifdef HAVE_RGUI
if (string_is_equal(settings->arrays.menu_driver, "rgui"))
if (string_is_equal(menu_ident, "rgui"))
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_RGUI;
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(settings->arrays.menu_driver, "glui"))
if (string_is_equal(menu_ident, "glui"))
label_value = MENU_ENUM_LABEL_VALUE_THUMBNAILS_MATERIALUI;
#endif
#endif
title = msg_hash_to_str(label_value);
@ -125,19 +123,18 @@ static int action_get_title_left_thumbnails(
const char *title = NULL;
enum msg_hash_enums label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS;
#if defined(HAVE_RGUI) || defined(HAVE_OZONE) || defined(HAVE_MATERIALUI)
settings_t *settings = config_get_ptr();
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_ident = menu_driver_ident();
/* Get label value */
#ifdef HAVE_RGUI
if (string_is_equal(menu_driver, "rgui"))
if (string_is_equal(menu_ident, "rgui"))
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_RGUI;
#endif
#ifdef HAVE_OZONE
if (string_is_equal(menu_driver, "ozone"))
if (string_is_equal(menu_ident, "ozone"))
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_OZONE;
#endif
#ifdef HAVE_MATERIALUI
if (string_is_equal(menu_driver, "glui"))
if (string_is_equal(menu_ident, "glui"))
label_value = MENU_ENUM_LABEL_VALUE_LEFT_THUMBNAILS_MATERIALUI;
#endif
#endif
@ -176,11 +173,11 @@ static int action_get_title_dropdown_item(
if (coreopts)
{
unsigned i;
settings_t *settings = config_get_ptr();
unsigned menu_index = string_to_unsigned(tmp_str_list->elems[(unsigned)tmp_str_list->size - 1].data);
unsigned visible_index = 0;
unsigned option_index = 0;
bool option_found = false;
settings_t *settings = config_get_ptr();
bool game_specific_options = settings->bools.game_specific_options;
/* Convert menu index to option index */

View File

@ -366,7 +366,7 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list)
const char *tmp_string = NULL;
const frontend_ctx_driver_t *frontend = frontend_get_ptr();
settings_t *settings = config_get_ptr();
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
tmp[0] = '\0';
@ -851,7 +851,7 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
size_t list_size = playlist_size(playlist);
settings_t *settings = config_get_ptr();
bool show_inline_core_name = false;
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
unsigned pl_show_inline_core_name = settings->uints.playlist_show_inline_core_name;
bool pl_show_sublabels = settings->bools.playlist_show_sublabels;
void (*sanitization)(char*);
@ -1112,7 +1112,7 @@ static int menu_displaylist_parse_database_entry(menu_handle_t *menu,
settings_t *settings = config_get_ptr();
bool show_advanced_settings = settings->bools.menu_show_advanced_settings;
const char *dir_playlist = settings->paths.directory_playlist;
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
path_playlist[0] = path_base[0] = query[0] = '\0';
@ -2434,12 +2434,14 @@ static unsigned menu_displaylist_parse_playlists(
if (!horizontal)
{
const char *menu_ident = menu_driver_ident();
/* When using MaterialUI with the navigation bar
* hidden, these 'add content' entries are accessible
* from the main menu 'Scan Content' entry. Placing
* them here as well is unnecessary/ugly duplication */
if (settings->bools.menu_content_show_add &&
!(string_is_equal(settings->arrays.menu_driver, "glui") &&
!(string_is_equal(menu_ident, "glui") &&
!settings->bools.menu_materialui_show_nav_bar))
{
#ifdef HAVE_LIBRETRODB
@ -2868,7 +2870,7 @@ static bool menu_displaylist_parse_playlist_manager_settings(
const char *playlist_file = NULL;
playlist_t *playlist = NULL;
settings_t *settings = config_get_ptr();
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
if (string_is_empty(playlist_path))
return false;
@ -4006,7 +4008,7 @@ static unsigned menu_displaylist_populate_subsystem(
char star_char[16];
unsigned count = 0;
settings_t *settings = config_get_ptr();
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
bool menu_show_sublabels = settings->bools.menu_show_sublabels;
/* Note: Create this string here explicitly (rather than
* using a #define elsewhere) since we need to be aware of
@ -7700,7 +7702,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
settings_t *settings = config_get_ptr();
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
const char *menu_driver = settings->arrays.menu_driver;
const char *menu_driver = menu_driver_ident();
bool is_rgui = string_is_equal(menu_driver, "rgui");
file_list_t *list = info->list;
unsigned p = atoi(info->path);
@ -9828,6 +9830,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
const char *menu_ident = menu_driver_ident();
if (rarch_ctl(RARCH_CTL_CORE_IS_RUNNING, NULL))
{
@ -9898,8 +9901,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
count++;
}
if ((string_is_equal(settings->arrays.menu_driver, "rgui") ||
string_is_equal(settings->arrays.menu_driver, "glui")) &&
if ((string_is_equal(menu_ident, "rgui") ||
string_is_equal(menu_ident, "glui")) &&
settings->bools.menu_content_show_playlists)
if (menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLISTS_TAB),

View File

@ -1617,7 +1617,7 @@ bool menu_entries_append_enum(file_list_t *list, const char *path,
size_t idx;
const char *menu_path = NULL;
menu_file_list_cbs_t *cbs = NULL;
settings_t *settings = config_get_ptr();
const char *menu_ident = menu_driver_ident();
if (!list || !label)
return false;
@ -1656,7 +1656,7 @@ bool menu_entries_append_enum(file_list_t *list, const char *path,
&& enum_idx != MENU_ENUM_LABEL_RDB_ENTRY)
cbs->setting = menu_setting_find_enum(enum_idx);
if (!string_is_equal(settings->arrays.menu_driver, "null"))
if (!string_is_equal(menu_ident, "null"))
menu_cbs_init(list, cbs, path, label, type, idx);
return true;

View File

@ -16170,17 +16170,11 @@ static void menu_input_get_mouse_hw_state(
static bool last_select_pressed = false;
static bool last_cancel_pressed = false;
bool mouse_enabled = settings->bools.menu_mouse_enable;
/* Note: RGUI requires special treatment, but we can't just
* check settings->arrays.menu_driver because this may change
* while another menu driver is active (and applying RGUI corrections
* while another menu driver is active will render the mouse unusable).
* We therefore have to check for the existence of a framebuffer
* texture instead (which is only ever set by RGUI) */
menu_handle_t *menu_data = menu_driver_get_ptr();
bool is_rgui =
(menu_data &&
menu_data->driver_ctx &&
menu_data->driver_ctx->set_texture);
bool menu_has_fb =
(menu_data &&
menu_data->driver_ctx &&
menu_data->driver_ctx->set_texture);
#ifdef HAVE_OVERLAY
bool overlay_enable = settings->bools.input_overlay_enable;
/* Menu pointer controls are ignored when overlays are enabled. */
@ -16221,7 +16215,7 @@ static void menu_input_get_mouse_hw_state(
last_y = hw_state->y;
/* > X/Y adjustment */
if (is_rgui)
if (menu_has_fb)
{
/* RGUI uses a framebuffer texture + custom viewports,
* which means we have to convert from screen space to
@ -16448,14 +16442,13 @@ static unsigned menu_event(
unsigned ok_current = BIT256_GET_PTR(p_input, menu_ok_btn);
unsigned ok_trigger = ok_current & ~ok_old;
#ifdef HAVE_RGUI
/* TODO/FIXME - instead of looking explicitly for the name rgui, instead
* perhaps check if set_texture is set - I assume we want to check if
* a menu driver is framebuffer-based instead of specifically looking if
* it's RGUI */
bool is_rgui = string_is_equal(
settings->arrays.menu_driver, "rgui");
menu_handle_t *menu_data = menu_driver_get_ptr();
bool menu_has_fb =
(menu_data &&
menu_data->driver_ctx &&
menu_data->driver_ctx->set_texture);
#else
bool is_rgui = false;
bool menu_has_fb = false;
#endif
ok_old = ok_current;
@ -16547,13 +16540,17 @@ static unsigned menu_event(
input_event_set_osk_idx((enum osk_type)(
osk_type_idx - 1));
else
input_event_set_osk_idx((enum osk_type)(is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1));
input_event_set_osk_idx((enum osk_type)(menu_has_fb
? OSK_SYMBOLS_PAGE1
: OSK_TYPE_LAST - 1));
}
if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R))
{
enum osk_type osk_type_idx = input_event_get_osk_idx();
if (osk_type_idx < (is_rgui ? OSK_SYMBOLS_PAGE1 : OSK_TYPE_LAST - 1))
if (osk_type_idx < (menu_has_fb
? OSK_SYMBOLS_PAGE1
: OSK_TYPE_LAST - 1))
input_event_set_osk_idx((enum osk_type)(
osk_type_idx + 1));
else
@ -16564,7 +16561,7 @@ static unsigned menu_event(
{
int ptr = input_event_get_osk_ptr();
if (ptr >= 0)
input_event_osk_append(ptr, is_rgui);
input_event_osk_append(ptr, menu_has_fb);
}
if (BIT256_GET_PTR(p_trigger_input, menu_cancel_btn))
@ -16776,13 +16773,14 @@ static float menu_input_get_dpi(void)
static unsigned last_video_height = 0;
static float dpi = 0.0f;
static bool dpi_cached = false;
bool menu_has_fb = false;
menu_handle_t *menu_data = menu_driver_get_ptr();
bool is_rgui;
if (!menu_data)
return 0.0f;
is_rgui = menu_data->driver_ctx && menu_data->driver_ctx->set_texture;
menu_has_fb = menu_data->driver_ctx
&& menu_data->driver_ctx->set_texture;
/* Regardless of menu driver, need 'actual' screen DPI
* Note: DPI is a fixed hardware property. To minimise performance
@ -16813,7 +16811,7 @@ static float menu_input_get_dpi(void)
* DPI in a traditional sense is therefore meaningless,
* so generate a substitute value based upon framebuffer
* dimensions */
if ((dpi > 0.0f) && is_rgui)
if ((dpi > 0.0f) && menu_has_fb)
{
size_t fb_pitch;
unsigned fb_width, fb_height;
@ -17225,10 +17223,15 @@ static int menu_input_pointer_post_iterate(
menu_driver_ctl(RARCH_MENU_CTL_OSK_PTR_AT_POS, &point);
if (point.retcode > -1)
{
menu_handle_t *menu_data = menu_driver_get_ptr();
bool menu_has_fb =
(menu_data &&
menu_data->driver_ctx &&
menu_data->driver_ctx->set_texture);
input_event_set_osk_ptr(point.retcode);
input_event_osk_append(point.retcode,
string_is_equal(
configuration_settings->arrays.menu_driver, "rgui"));
menu_has_fb);
}
}
}

View File

@ -1016,6 +1016,8 @@ void runtime_update_playlist(playlist_t *playlist, size_t idx)
#if defined(HAVE_MENU) && defined(HAVE_OZONE)
/* Ozone requires runtime/last played strings to be
* populated even when no runtime is recorded */
/* TODO/FIXME - we shouldn't rely here on the settings
* struct - not safe */
if (string_is_equal(settings->arrays.menu_driver, "ozone"))
{
if (update_entry.runtime_status != PLAYLIST_RUNTIME_VALID)

View File

@ -566,13 +566,11 @@ static void cb_task_pl_entry_thumbnail_refresh_menu(
bool do_refresh = false;
playlist_t *current_playlist = playlist_get_cached();
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
const char *menu_driver = NULL;
const char *menu_driver = menu_driver_ident();
if (!task || !settings)
if (!task)
return;
menu_driver = settings->arrays.menu_driver;
pl_thumb = (pl_thumb_handle_t*)task->state;
if (!pl_thumb || !pl_thumb->thumbnail_path_data)