Page 1 of 1

libvlc_media_new seems to not work

Posted: 04 Apr 2009 22:16
by keitaro57
Hi all,

No exception raised when calling the libvlc_media_new function but the program crash when using the libvlc_media_t pointers (with libvlc_media_release and with libvlc_mediaplayer_new_form_media).

Anyone has an idea why the crash appears?

Here is the code of my test function:

Code: Select all

const char * const vlc_args[] = { "-I", "dummy", /* Don't use any interface */ "--ignore-config", /* Don't use VLC's config */ "--plugin-path=plugins" }; m_pVLCInstance = libvlc_new(sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args, &m_VLCException); if( libvlc_exception_raised(&m_VLCException) ) { QMessageBox::warning(this, tr("error"), libvlc_exception_get_message(&m_VLCException), QMessageBox::Ok); libvlc_exception_clear(&m_VLCException); return; } libvlc_media_new(m_pVLCInstance, "test.avi", &m_VLCException); if( libvlc_exception_raised(&m_VLCException) ) { QMessageBox::warning(this, tr("error"), libvlc_exception_get_message(&m_VLCException), QMessageBox::Ok); libvlc_exception_clear(&m_VLCException); return; } m_pVLCPlayer = libvlc_media_player_new_from_media(m_pVLCMedia, &m_VLCException); libvlc_media_release(m_pVLCMedia);
Thanks

Re: libvlc_media_new seems to not work

Posted: 04 Apr 2009 22:38
by RĂ©mi Denis-Courmont
You're not supposed to release a media which is being used by a player, as far as I know.

Re: libvlc_media_new seems to not work

Posted: 04 Apr 2009 22:50
by keitaro57
it is written in the tutorial that the media can be release once added in the media player.

But even if I comment the media relese instruction it is crashing