Pass video_is_threaded variable to video_driver_init

This commit is contained in:
twinaphex 2017-04-29 17:10:59 +02:00
parent 64b672125c
commit 03145a0424
3 changed files with 14 additions and 8 deletions

View File

@ -295,6 +295,7 @@ static bool driver_update_system_av_info(const struct retro_system_av_info *info
**/ **/
void drivers_init(int flags) void drivers_init(int flags)
{ {
bool video_is_threaded = false;
if (flags & DRIVER_VIDEO_MASK) if (flags & DRIVER_VIDEO_MASK)
video_driver_unset_own_driver(); video_driver_unset_own_driver();
if (flags & DRIVER_AUDIO_MASK) if (flags & DRIVER_AUDIO_MASK)
@ -322,7 +323,7 @@ void drivers_init(int flags)
video_driver_get_hw_context(); video_driver_get_hw_context();
video_driver_monitor_reset(); video_driver_monitor_reset();
video_driver_init(); video_driver_init(&video_is_threaded);
if (!video_driver_is_video_cache_context_ack() if (!video_driver_is_video_cache_context_ack()
&& hwr->context_reset) && hwr->context_reset)
@ -349,10 +350,13 @@ void drivers_init(int flags)
core_info_init_current_core(); core_info_init_current_core();
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (flags & DRIVER_MENU_MASK) if (flags & DRIVER_VIDEO_MASK)
{ {
menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL); if (flags & DRIVER_MENU_MASK)
menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_RESET, NULL); {
menu_driver_ctl(RARCH_MENU_CTL_INIT, NULL);
menu_driver_ctl(RARCH_MENU_CTL_CONTEXT_RESET, NULL);
}
} }
#endif #endif

View File

@ -681,7 +681,7 @@ error:
return false; 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; unsigned max_dim, scale, width, height;
const input_driver_t *tmp = NULL; const input_driver_t *tmp = NULL;
@ -809,6 +809,8 @@ static bool video_driver_init_internal(void)
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
video.is_threaded = video_driver_is_threaded(); video.is_threaded = video_driver_is_threaded();
*video_is_threaded = video.is_threaded;
if (video.is_threaded) if (video.is_threaded)
{ {
/* Can't do hardware rendering with threaded driver currently. */ /* Can't do hardware rendering with threaded driver currently. */
@ -1523,10 +1525,10 @@ bool video_driver_get_prev_video_out(void)
return true; return true;
} }
bool video_driver_init(void) bool video_driver_init(bool *video_is_threaded)
{ {
video_driver_lock_new(); video_driver_lock_new();
return video_driver_init_internal(); return video_driver_init_internal(video_is_threaded);
} }
void video_driver_destroy_data(void) void video_driver_destroy_data(void)

View File

@ -344,7 +344,7 @@ void video_driver_unset_rgba(void);
bool video_driver_supports_rgba(void); bool video_driver_supports_rgba(void);
bool video_driver_get_next_video_out(void); bool video_driver_get_next_video_out(void);
bool video_driver_get_prev_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_destroy_data(void);
void video_driver_free(void); void video_driver_free(void);
void video_driver_free_hw_context(void); void video_driver_free_hw_context(void);