From 2271dbe3df3cf8ae322c5532e794a04f31ee5811 Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Sat, 7 Dec 2002 23:00:07 +0000 Subject: All gui_data_exchange containing X calls may xlocked/xunlocked. Don't forget to xfreeing gc before creating a new one. CVS patchset: 3459 CVS date: 2002/12/07 23:00:07 --- src/video_out/video_out_pgx64.c | 3 ++- src/video_out/video_out_syncfb.c | 6 +++++- src/video_out/video_out_xshm.c | 8 +++++--- src/video_out/video_out_xv.c | 8 ++++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c index 2e1fad37e..14f80262a 100644 --- a/src/video_out/video_out_pgx64.c +++ b/src/video_out/video_out_pgx64.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_pgx64.c,v 1.16 2002/12/07 01:14:52 komadori Exp $ + * $Id: video_out_pgx64.c,v 1.17 2002/12/07 23:00:07 f1rmb Exp $ * * video_out_pgx64.c, Sun PGX64/PGX24 output plugin for xine * @@ -538,6 +538,7 @@ static int pgx64_gui_data_exchange(pgx64_driver_t *this, int data_type, void *da this->drawable = (Drawable)data; #ifdef HAVE_X11 XLockDisplay(this->display); + XFreeGC(this->display, this->gc); this->gc = XCreateGC(this->display, this->drawable, 0, NULL); XUnlockDisplay(this->display); #endif diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index 45bb855af..b8d82f6e7 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_syncfb.c,v 1.80 2002/11/22 18:06:20 mroi Exp $ + * $Id: video_out_syncfb.c,v 1.81 2002/12/07 23:00:08 f1rmb Exp $ * * video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine * @@ -762,7 +762,11 @@ static int syncfb_gui_data_exchange(vo_driver_t* this_gen, int data_type, switch (data_type) { case XINE_GUI_SEND_DRAWABLE_CHANGED: this->drawable = (Drawable) data; + + XLockDisplay (this->display); + XFreeGC(this->display, this->gc); this->gc = XCreateGC (this->display, this->drawable, 0, NULL); + XUnlockDisplay (this->display); break; case GUI_DATA_EX_TRANSLATE_GUI_TO_VIDEO: { diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 638032fd4..9a759c1f9 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xshm.c,v 1.97 2002/12/06 01:33:01 miguelfreitas Exp $ + * $Id: video_out_xshm.c,v 1.98 2002/12/07 23:00:09 f1rmb Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -928,9 +928,11 @@ static int xshm_gui_data_exchange (vo_driver_t *this_gen, case XINE_GUI_SEND_DRAWABLE_CHANGED: this->drawable = (Drawable) data; + XLockDisplay (this->display); XFreeGC(this->display, this->gc); - this->gc = XCreateGC (this->display, this->drawable, 0, NULL); - + this->gc = XCreateGC (this->display, this->drawable, 0, NULL); + XUnlockDisplay (this->display); + break; case XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO: diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 61e7a13d6..44862a692 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.153 2002/12/06 01:33:01 miguelfreitas Exp $ + * $Id: video_out_xv.c,v 1.154 2002/12/07 23:00:09 f1rmb Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -911,7 +911,11 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, case XINE_GUI_SEND_DRAWABLE_CHANGED: this->drawable = (Drawable) data; - this->gc = XCreateGC (this->display, this->drawable, 0, NULL); + + XLockDisplay (this->display); + XFreeGC(this->display, this->gc); + this->gc = XCreateGC (this->display, this->drawable, 0, NULL); + XUnlockDisplay (this->display); break; case XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO: -- cgit v1.2.3