diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 55d17eb27a..794d1e83a9 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -223,8 +223,6 @@ typedef struct content_playlist_t *db_playlist; char db_playlist_file[PATH_MAX_LENGTH]; - database_info_handle_t *db; - } menu_handle_t; typedef struct menu_ctx_driver diff --git a/runloop_data.c b/runloop_data.c index a61eabd06e..1e2d32ba76 100644 --- a/runloop_data.c +++ b/runloop_data.c @@ -103,11 +103,9 @@ static void data_runloop_iterate(bool is_thread, data_runloop_t *runloop) #ifdef HAVE_NETWORKING rarch_main_data_http_iterate (is_thread, runloop); #endif -#ifdef HAVE_MENU #ifdef HAVE_LIBRETRODB rarch_main_data_db_iterate (is_thread, runloop); #endif -#endif } @@ -128,13 +126,10 @@ bool rarch_main_data_active(data_runloop_t *runloop) struct http_connection_t *http_conn = http ? http->connection.handle : NULL; #endif #ifdef HAVE_LIBRETRODB -#ifdef HAVE_MENU - menu_handle_t *menu = menu_driver_get_ptr(); - database_info_handle_t *db = menu ? menu->db : NULL; + database_info_handle_t *db = runloop ? runloop->db.handle : NULL; db_active = db && db->status != DATABASE_STATUS_NONE; active = active || db_active; #endif -#endif #ifdef HAVE_OVERLAY overlay_active = driver && driver->overlay && diff --git a/runloop_data.h b/runloop_data.h index 72a2b208f6..507c307295 100644 --- a/runloop_data.h +++ b/runloop_data.h @@ -23,6 +23,9 @@ #ifdef HAVE_THREADS #include #endif +#ifdef HAVE_LIBRETRODB +#include "database_info.h" +#endif #include "tasks/tasks.h" #ifdef __cplusplus @@ -122,6 +125,7 @@ typedef struct nbio_handle typedef struct db_handle { + database_info_handle_t *handle; msg_queue_t *msg_queue; unsigned status; } db_handle_t; diff --git a/tasks/task_database.c b/tasks/task_database.c index 6e985e9a69..e08a2de981 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -17,15 +17,12 @@ #include "../file_ext.h" #include "../file_ops.h" -#include "../menu/menu_driver.h" - #include "../general.h" #include "../runloop_data.h" #include "tasks.h" #ifdef HAVE_LIBRETRODB -#ifdef HAVE_MENU #ifdef HAVE_ZLIB static int zlib_compare_crc32(const char *name, const char *valid_exts, @@ -123,10 +120,9 @@ static int database_info_iterate(database_info_handle_t *db) void rarch_main_data_db_iterate(bool is_thread, void *data) { data_runloop_t *runloop = (data_runloop_t*)data; - menu_handle_t *menu = menu_driver_get_ptr(); - database_info_handle_t *db = menu ? menu->db : NULL; + database_info_handle_t *db = runloop ? runloop->db.handle : NULL; - if (!db || !menu || !runloop) + if (!db || !runloop) return; switch (db->status) @@ -144,4 +140,3 @@ void rarch_main_data_db_iterate(bool is_thread, void *data) } } #endif -#endif