Ahh, yes I miss-understood
OK , I really don't like this .. but one way to do it
coproc cvlc "$@" 2> cvlc.log
while [ $COPROC_PID ];do
grep -q "xcb_window window error" cvlc.log && kill $COPROC_PID ; sleep 10 || sleep 10
you will want to put the log somewhere 'clean' instead of the working dir as above put you get the idea
I never liked vlc so I never use it
Any reason you can't use mplayer?