diff --git a/driver.c b/driver.c index c0f618c5ea..ca54f14b55 100644 --- a/driver.c +++ b/driver.c @@ -295,6 +295,7 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info **/ void drivers_init(int flags) { + bool video_is_threaded = false; if (flags & DRIVER_VIDEO_MASK) video_driver_unset_own_driver(); if (flags & DRIVER_AUDIO_MASK) @@ -322,7 +323,7 @@ void drivers_init(int flags) video_driver_get_hw_context(); video_driver_monitor_reset(); - video_driver_init(); + video_driver_init(&video_is_threaded); if (!video_driver_is_video_cache_context_ack() && hwr->context_reset) @@ -349,10 +350,13 @@ void drivers_init(int flags) core_info_init_current_core(); #ifdef HAVE_MENU - if (flags & DRIVER_MENU_MASK) + if (flags & DRIVER_VIDEO_MASK) { - menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL); - menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_RESET, NULL); + if (flags & DRIVER_MENU_MASK) + { + menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL); + menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_RESET, NULL); + } } #endif diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 942126f87d..63c6e7c7c3 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -681,7 +681,7 @@ error: return false; } -static bool video_driver_init_internal(void) +static bool video_driver_init_internal(bool *video_is_threaded) { unsigned max_dim, scale, width, height; const input_driver_t *tmp = NULL; @@ -809,6 +809,8 @@ static bool video_driver_init_internal(void) #ifdef HAVE_THREADS video.is_threaded = video_driver_is_threaded(); + *video_is_threaded = video.is_threaded; + if (video.is_threaded) { /* Can't do hardware rendering with threaded driver currently. */ @@ -1523,10 +1525,10 @@ bool video_driver_get_prev_video_out(void) return true; } -bool video_driver_init(void) +bool video_driver_init(bool *video_is_threaded) { video_driver_lock_new(); - return video_driver_init_internal(); + return video_driver_init_internal(video_is_threaded); } void video_driver_destroy_data(void) diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 97633aff32..3f08cee111 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -344,7 +344,7 @@ void video_driver_unset_rgba(void); bool video_driver_supports_rgba(void); bool video_driver_get_next_video_out(void); bool video_driver_get_prev_video_out(void); -bool video_driver_init(void); +bool video_driver_init(bool *video_is_threaded); void video_driver_destroy_data(void); void video_driver_free(void); void video_driver_free_hw_context(void);