I'm trying to write a video playing app in c++ using visual studio 2005 and keep getting a crash every time I call libvlc_new(). In the past I have been successful playing videos with this code but now they won't work at all and nothing seems to have changed. I have tried versions 0.9.6 and 0.9.8a without any luck.
Debugging my code shows that the crash happens in _Orphan_all which appears to be getting called from VLC. Has anybody experienced this before?
Here's the code I'm using:
Code: Select all
VlcWrapper::VlcWrapper(long lVideoWidth, long lVideoHeight, long lVideoPitch, void* pLock, void* pUnlock, void* pData)
{
char arg_lock[64], arg_unlock[64], arg_data[64];
char arg_width[32], arg_height[32], arg_pitch[32];
sprintf_s(arg_lock, "%lld", (long long int)(intptr_t)pLock);
sprintf_s(arg_unlock, "%lld", (long long int)(intptr_t)pUnlock);
sprintf_s(arg_data, "%lld", (long long int)(intptr_t)pData);
sprintf_s(arg_width, "%i", lVideoWidth);
sprintf_s(arg_height, "%i", lVideoHeight);
sprintf_s(arg_pitch, "%i", lVideoWidth * lVideoPitch);
const char* args[] = {
"-I",
"dummy",
"-vvvvvvv",
"--plugin-path=C:\\vlc\\runtime\\plugins",
"--ignore-config",
"--no-audio",
"--no-video-title-show",
"--verbose=2",
"--vout",
"vmem",
"--vmem-width",
arg_width,
"--vmem-height",
arg_height,
"--vmem-pitch",
arg_pitch,
"--vmem-lock",
arg_lock,
"--vmem-unlock",
arg_unlock,
"--vmem-data",
arg_data,
"--vmem-chroma",
"RV32"
};
// These members are usually in the class header - I've moved them here for ease of reading
libvlc_exception_t m_excp;
libvlc_instance_t* m_inst;
libvlc_exception_init( &m_excp );
//This is where the crash happens
m_inst = libvlc_new( sizeof(args) / sizeof(args[0]), args, &m_excp );
}
Thanks for any help.