diff options
author | phintuka <phintuka> | 2008-03-31 22:32:43 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-03-31 22:32:43 +0000 |
commit | 47b24dff0803f217cb46291faf2adfc808858dfd (patch) | |
tree | 5b2a614a8f23dfe3cdf4f049ffc8fee35b0d9bd3 | |
parent | 894111e4772bfe47f90c784bdf761910cd13eb75 (diff) | |
download | xineliboutput-47b24dff0803f217cb46291faf2adfc808858dfd.tar.gz xineliboutput-47b24dff0803f217cb46291faf2adfc808858dfd.tar.bz2 |
Disable HUD if ARGB visual not found.
Override xine_osd_command function only if HUD initialization succeeds.
-rw-r--r-- | xine_sxfe_frontend.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c index 71d62067..af60ed49 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.36 2008-03-31 22:28:45 phintuka Exp $ + * $Id: xine_sxfe_frontend.c,v 1.37 2008-03-31 22:32:43 phintuka Exp $ * */ @@ -679,6 +679,12 @@ static int hud_osd_open(frontend_t *this_gen) LOGDBG("opening HUD OSD window..."); this->hud_vis = find_argb_visual(this->display, DefaultScreen(this->display)); + if(!this->hud_vis) { + LOGMSG("find_argb_visual() failed. HUD OSD disabled."); + this->hud = 0; + XUnlockDisplay(this->display); + return 1; + } Colormap hud_colormap = XCreateColormap(this->display, RootWindow(this->display, DefaultScreen(this->display)), @@ -732,6 +738,10 @@ static int hud_osd_open(frontend_t *this_gen) this->surf_img = xrender_surf_new(this->display, this->hud_window, this->hud_vis, HUD_MAX_WIDTH, HUD_MAX_HEIGHT, 1); XUnlockDisplay(this->display); + +#ifndef FE_STANDALONE + this->fe.xine_osd_command = hud_osd_command; +#endif } return 1; } @@ -779,18 +789,6 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu XSizeHints hint; double res_h, res_v, aspect_diff; - if(hud) { - LOGDBG("Enabling HUD\n"); - this->hud = hud; - this->osd_width = OSD_DEF_WIDTH; - this->osd_height = OSD_DEF_HEIGHT; - this->osd_pad_x = 0; - this->osd_pad_y = 0; -#ifndef FE_STANDALONE - this->fe.xine_osd_command = hud_osd_command; -#endif - } - if(this->display) this->fe.fe_display_close(this_gen); @@ -802,6 +800,15 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu LOGDBG("sxfe_display_open(width=%d, height=%d, fullscreen=%d, display=%s)", width, height, fullscreen, video_port); + if(hud) { + LOGDBG("sxfe_display_open: Enabling HUD OSD"); + this->hud = hud; + this->osd_width = OSD_DEF_WIDTH; + this->osd_height = OSD_DEF_HEIGHT; + this->osd_pad_x = 0; + this->osd_pad_y = 0; + } + this->xpos = 0; this->ypos = 0; this->origxpos = 0; |