This crash only happens under these circumstances:
- when in release mode (not in debug mode)
- when vlc instance is NOT initialized with "--no-audio" argument
- with vlc 1.0.1 (I also tested with 0.9.10 and it worked fine with the same code)
Video and audio play fine and then libvlc_media_player_stop function crashes whole application with RUN FAILED (exit value 139...). I'm using gentoo and qt4 and haven't tested in other systems. Is this a bug in vlc 1.0.1 or am I missing something?
Code to reproduce:
libvlc_instance_t* vlcInstance;
libvlc_exception_t vlcException;
libvlc_media_player_t *player;
libvlc_media_t *media;
QTimer timer;
QEventLoop loop;
timer.setSingleShot(true);
QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
const char * const vlc_args[] = {
//"--no-audio" //uncomment to see that with this argument it works ok
};
libvlc_exception_init (&vlcException);
vlcInstance = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &vlcException);
media = libvlc_media_new (vlcInstance, "video.avi", &vlcException);
player = libvlc_media_player_new_from_media (media, &vlcException);
libvlc_media_player_set_xwindow(player, widget.frameResults->winId(), &vlcException);
//libvlc_drawable_t drawable = widget.frameResults->winId(); //uncomment to test on vlc<1.0.0
//libvlc_media_player_set_drawable (player, drawable, &vlcException);
libvlc_media_player_play (player, &vlcException);
timer.start(5000); // let it play for 5s
loop.exec();
libvlc_media_player_stop (player, &vlcException); // crashes here