Fix threaded driver.

Fix case when no poke interface was implemented.
This commit is contained in:
Themaister 2013-04-13 14:35:24 +02:00
parent e389220df8
commit f73f1971f9
3 changed files with 17 additions and 3 deletions

View File

@ -197,6 +197,10 @@ static void *sdl_gfx_init(const video_info_t *video, const input_driver_t **inpu
gfx_set_dwm(); gfx_set_dwm();
#endif #endif
#ifdef HAVE_X11
XInitThreads();
#endif
SDL_InitSubSystem(SDL_INIT_VIDEO); SDL_InitSubSystem(SDL_INIT_VIDEO);
sdl_video_t *vid = (sdl_video_t*)calloc(1, sizeof(*vid)); sdl_video_t *vid = (sdl_video_t*)calloc(1, sizeof(*vid));

View File

@ -306,7 +306,9 @@ static void thread_loop(void *data)
thr->texture.alpha); thr->texture.alpha);
thr->texture.frame_updated = false; thr->texture.frame_updated = false;
} }
thr->poke->set_texture_enable(thr->driver_data, thr->texture.enable);
if (thr->poke && thr->poke->set_texture_enable)
thr->poke->set_texture_enable(thr->driver_data, thr->texture.enable);
#endif #endif
if (thr->apply_state_changes) if (thr->apply_state_changes)
@ -688,8 +690,14 @@ static const video_poke_interface_t thread_poke = {
static void thread_get_poke_interface(void *data, const video_poke_interface_t **iface) static void thread_get_poke_interface(void *data, const video_poke_interface_t **iface)
{ {
thread_video_t *thr = (thread_video_t*)data; thread_video_t *thr = (thread_video_t*)data;
*iface = &thread_poke;
thr->driver->poke_interface(thr->driver_data, &thr->poke); if (thr->driver->poke_interface)
{
*iface = &thread_poke;
thr->driver->poke_interface(thr->driver_data, &thr->poke);
}
else
*iface = NULL;
} }
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) #if defined(HAVE_RMENU) || defined(HAVE_RGUI)

View File

@ -330,6 +330,8 @@ static void *xv_init(const video_info_t *video, const input_driver_t **input, vo
if (!xv) if (!xv)
return NULL; return NULL;
XInitThreads();
xv->display = XOpenDisplay(NULL); xv->display = XOpenDisplay(NULL);
struct sigaction sa; struct sigaction sa;
unsigned adaptor_count = 0; unsigned adaptor_count = 0;