Postby ror27 » 12 Aug 2007 03:41
I thought as much, in fact I wanted the ability to be able to change the active Visualization halfway through - seems a reasonable enough idea.
However after much experimentation it appears that once the Visualization plugin is loaded, it is loaded apparently and can't be changed regardless of what state you put the control into.
No matter I thought, I'd save the current play state - including position - destroy the control and create a new one, setting the visualization then restoring the state.
Nice theory. However upon running the code I was immediately greeted with one of Redmond's finest bluescreens. Double-checked everything, yes I was properly disposing everything and giving it all time to cleanup. After settling in for a reluctant minidump analysis session, it appears for strange reasons relating to the Interop library that all sorts of weird garbage collecting race conditions conspire to cause simultaneous allocation and deallocation of the video buffer in the same thread, causing my graphics driver (nVidia Forceware) to get confused and keel over.
Basically creating a new control is not the way to go. There does appear to be a proper way of dynamically signalling VLC to reload the visualization plugin, which evidently the VLC Player itself uses to allow the user to change the Visualization midway through, but there's nothing obvious exposed through libvlc.
Even if someone does clarify the above, or an obscure bug is fixed, I am of the opinion that for a given media file (and thus instance of VLC) the content will either be with or without video. Hence you will either want or won't want a visualization - i.e. set or don't set a visualization at the start and leave it that way, who would want to use anything other than goom anyway?