[vlc-devel] commit: UIs: call XInitThreads if using X11 ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Feb 21 10:19:41 CET 2010
vlc/vlc-1.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 21 11:19:17 2010 +0200| [6c7b7c4ea4e0161a197ad0ec897fef582be39b52] | committer: Rémi Denis-Courmont
UIs: call XInitThreads if using X11
This is needed to protect the Xlib internal state. Xlib may still be
used by user interface thread, the GLX video output thread(s) and
PulseAudio -audio thread- while it initializes.
Fortunately, we do not need to lock X11 displays as every thread uses
its own. Hopefully Xlib is not buggy in that respect, but I am not so
sure :(
This should fix LP #419915.
(cherry picked from commit e056b5805aabed93d484dd92131463b760261b89)
Conflicts:
modules/gui/hildon/maemo.c
modules/gui/qt4/qt4.cpp
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.0.git/?a=commit;h=6c7b7c4ea4e0161a197ad0ec897fef582be39b52
---
modules/gui/maemo/maemo.c | 3 +++
modules/gui/qt4/qt4.cpp | 2 ++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/modules/gui/maemo/maemo.c b/modules/gui/maemo/maemo.c
index 4d2234c..30f6a4e 100644
--- a/modules/gui/maemo/maemo.c
+++ b/modules/gui/maemo/maemo.c
@@ -81,6 +81,9 @@ static int Open( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
+ if( !XInitThreads() )
+ return VLC_EGENERIC;
+
/* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 25978af..2793f5e 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -273,6 +273,8 @@ static int Open( vlc_object_t *p_this )
intf_thread_t *p_intf = (intf_thread_t *)p_this;
#ifdef Q_WS_X11
+ if( !XInitThreads() )
+ return VLC_EGENERIC;
char *psz_display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
Display *p_display = XOpenDisplay( psz_display );
free( psz_display );
More information about the vlc-devel
mailing list