libvlc_media_new seems to not work

This forum is about all development around libVLC.
keitaro57
New Cone
New Cone
Posts: 6
Joined: 23 Mar 2009 22:53
VLC version: 0.9
Operating System: Linux & Windows

libvlc_media_new seems to not work

Postby keitaro57 » 04 Apr 2009 22:16

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15279
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_media_new seems to not work

Postby Rémi Denis-Courmont » 04 Apr 2009 22:38

You're not supposed to release a media which is being used by a player, as far as I know.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

keitaro57
New Cone
New Cone
Posts: 6
Joined: 23 Mar 2009 22:53
VLC version: 0.9
Operating System: Linux & Windows

Re: libvlc_media_new seems to not work

Postby keitaro57 » 04 Apr 2009 22:50

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 41 guests