[vlc-devel] problem with libvlc_media_player_set_xwindow and a X window created by XCB

Rémi Denis-Courmont remi at remlab.net
Sun Feb 28 16:53:43 CET 2010


Le samedi 27 février 2010 13:59:06 Mathieu SCHROETER, vous avez écrit :
> Hello,
> 
> I tried to use libvlc 1.1 (tested against [1]) to play a video in a
> X window created directly by XCB. But unfortunately, it returns
> some errors. I don't know if there is a bug somewhere in libvlc..
> or maybe my use of libvlc is wrong?!
> 
> I've attached a small test app to reproduce the problem.. it creates
> a window in fullscreen, plays a video, and waits 2 sec. The window
> stays black and there are some errors printed by libvlc. Note that
> a window created in this way is perfectly usable with `mplayer -wid`
> and xine-lib.

Your sample code works fine here. Maybe you did not build the xcb_window 
plugin.

That said, your sample code looks wrong in several ways. First, I fail to see 
what warrants that the window was created before you start VLC playback. In 
practice, the X server most likely already did create the window. But you have 
a race there. LibVLC will be using *another* X11 connection, so the 
create_window request must be acknowledged first to ensure correct sequencing.
Do note that xcb_flush() only sends request to the server, just like 
XFlush()). It makes no warranty that the server processed the request, 
contrary to XSync().

Then, resetting the plugin cache is very slow, and not a very good idea.

--no-one-instance is pointless, as it is the default anyway. Worse yet, it 
makes your code fail if VLC was built without single instance support (i.e. 
without DBus).

Similarly --ignore-config is also default, and useless.

Last, --intf=dummy has no effects as libvlc_add_intf() is not used.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list