I was having an issue in some of my code where if I called libvlc_media_player_set_xwindow, it would sometimes fail, and libvlc would then display in it's own default window instead of using my nice crisp new window (which was definately there). I could never get it to occur on my development computer, but it kept appearing on the production computer.
From my limited understanding of X, it seems that the window may not have been completely created yet (even though I had a valid handle for it), and so libvlc was rejecting it. If I place a call to "XSync(display,False)" just before calling libvlc_media_player_set_xwindow, it cleared up my problem.
This only seems to appear when the X-System is fairly busy in other windows doing some drawing.