diff options
| author | phintuka <phintuka> | 2011-07-01 12:34:45 +0000 |
|---|---|---|
| committer | phintuka <phintuka> | 2011-07-01 12:34:45 +0000 |
| commit | 39cbcdf372a3f48fddb3801e1d446a5f2f2e2634 (patch) | |
| tree | 48f1995b5bad7b29f084262e43ca3b66aee995e2 | |
| parent | a308779f8137106cbe9e56a977cd16076b6c7254 (diff) | |
| download | xineliboutput-39cbcdf372a3f48fddb3801e1d446a5f2f2e2634.tar.gz xineliboutput-39cbcdf372a3f48fddb3801e1d446a5f2f2e2634.tar.bz2 | |
Moved OpenGL init to opengl drawing thread
(patch #3206794, thanks to grueni75)
| -rw-r--r-- | xine_sxfe_frontend.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index b582ee36..518272fd 100644 --- a/xine_sxfe_frontend.c +++ b/xine_sxfe_frontend.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: xine_sxfe_frontend.c,v 1.159 2011-07-01 12:33:20 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.160 2011-07-01 12:34:45 phintuka Exp $ * */ @@ -1770,6 +1770,14 @@ static void *opengl_draw_frame_thread(void *arg) XDouble video_tex_width, video_tex_height; int first_frame = 1; + XLockDisplay (this->display); + if (opengl_init(this) < 0) { + LOGMSG("OpenGL initialization failed"); + XUnlockDisplay (this->display); + exit(1); + } + XUnlockDisplay (this->display); + while (1) { // Wait for trigger @@ -1924,15 +1932,6 @@ static int opengl_start(sxfe_t *this) LOGDBG("sxfe_display_open: starting opengl drawing thread"); pthread_mutex_init(&this->opengl_redraw_mutex, NULL); pthread_cond_init(&this->opengl_redraw_cv, NULL); - - XLockDisplay (this->display); - if (opengl_init(this) < 0) { - LOGMSG("OpenGL initialization failed"); - XUnlockDisplay (this->display); - return 0; - } - XUnlockDisplay (this->display); - pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); |
